Products: How can I select a product inside CMS content page

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
blackrain
Forum Members
Forum Members
Posts: 98
Joined: Wed Feb 20, 2008 4:33 pm

Products: How can I select a product inside CMS content page

Post by blackrain »

I am trying to find a way to allow users to select a product from the Product module and add it to a page, either a dropdown or multi-select is adequate.

Obviously if there is way to see image of product that would e helpful.

many thanks

Mark
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1629
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: Products: How can I select a product inside CMS content

Post by DIGI3 »

CGContentUtilities lets you add a dropdown as a content block, and the options can be from a Smarty template. So in the CGCU dropdown options field you should be able to add something like:

Code: Select all

{cms_module module='Products' summarytemplate='my_options_template'}
Where my_options_template is a template you create for Products that puts one item per line, with the option and value separated by a pipe character.

You may have to experiment with the template a bit to get line breaks and the formatting right.

Also, there's a bug in CGCU which will stop this from working, so you may have to encourage/bribe/beg the module developer for an update or use version CGCU 2.4 or older:
http://dev.cmsmadesimple.org/bug/view/12238
Not getting the answer you need? CMSMS support options
blackrain
Forum Members
Forum Members
Posts: 98
Joined: Wed Feb 20, 2008 4:33 pm

Re: Products: How can I select a product inside CMS content

Post by blackrain »

Hi @DIGI3

The cms page shows "An invalid curpage was passed toProducts\DisplayableProduct::__construct" in the dropdown. not sure why this is happening.
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1629
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: Products: How can I select a product inside CMS content

Post by DIGI3 »

Perhaps it won't work then - it's my usual method with a lot of modules but I didn't try it on Products as I didn't get past the bug I mentioned. It looks like Products wants to see what frontend page it's being called from. Perhaps Calguy can offer more info.

The other option would be to write a plugin/udt to pull the products from the database and use that to populate the CGCU options.
Not getting the answer you need? CMSMS support options
Post Reply

Return to “Modules/Add-Ons”