[solved] call a single product in products module

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
kurashiki_ben
Forum Members
Forum Members
Posts: 86
Joined: Sun Jul 05, 2009 2:37 am

[solved] call a single product in products module

Post by kurashiki_ben »

Hello,

I am using Products 2.3.1 in CMS Made Simple 1.5.4 "Carolina"

I am trying to call the product details page for a single product into a cms page using the following:

Code: Select all

{Products action='detail' productid='1'}.
However, when I load the page, all I get is a dot (.) .

Is the syntax correct?

The product does exist and I can get to it ok from the category summary page.


Any ideas?


Regards

Ben
Last edited by kurashiki_ben on Tue Nov 03, 2009 7:28 am, edited 1 time in total.
starbits
Forum Members
Forum Members
Posts: 47
Joined: Tue Oct 09, 2007 9:41 pm

Re: call a single product in products module

Post by starbits »

I have tried this too, using CMS 1.6.6 and Products 2.4.3.  First, note that the current documentation specifies action="details" (plural), but I have tried it both ways and I get smarty errors:
string(140) "Smarty error: [in content:content_en line 1]: syntax error: invalid attribute name: 'action' (Smarty_Compiler.class.php, line 1550)" string(126) "Smarty error: [in content:content_en line 1]: syntax error: invalid attribute name: '=' (Smarty_Compiler.class.php, line 1550)" string(134) "Smarty error: [in content:content_en line 1]: syntax error: invalid attribute name: '"details"' (Smarty_Compiler.class.php, line 1550)"

My tag: {Products action="details" productid="1"}

If I take out the action parameter and just leave productid, that give errors too.  But the example given in the documentation, {Products category='categoryname'} works fine.

I suspect we are doing something wrong, but it is not obvious from the documentation.  If you find a solution, please post it.
Steve
starbits
Forum Members
Forum Members
Posts: 47
Joined: Tue Oct 09, 2007 9:41 pm

Re: call a single product in products module

Post by starbits »

This works, although not exactly as I had hoped:

{module_action_link module='Products' action='details' productid="1"}

It does not give any errors just the word "Products", which is a link that when clicked, will give you the details of the item you specify.  I was hoping it would give the details directly without needing to click on the "Products" link.
Last edited by starbits on Wed Oct 28, 2009 11:54 pm, edited 1 time in total.
kurashiki_ben
Forum Members
Forum Members
Posts: 86
Joined: Sun Jul 05, 2009 2:37 am

Re: call a single product in products module

Post by kurashiki_ben »

starbits wrote: This works, although not exactly as I had hoped:

{module_action_link module='Products' action='details' productid="1"}

It does not give any errors just the word "Products", which is a link that when clicked, will give you the details of the item you specify.  I was hoping it would give the details directly without needing to click on the "Products" link.
starbits,

thanks for your post.
I will have another play around and see if I can build on what you have done.

Regards

Ben
kurashiki_ben
Forum Members
Forum Members
Posts: 86
Joined: Sun Jul 05, 2009 2:37 am

Re: call a single product in products module

Post by kurashiki_ben »

starbits wrote: This works, although not exactly as I had hoped:

{module_action_link module='Products' action='details' productid="1"}

It does not give any errors just the word "Products", which is a link that when clicked, will give you the details of the item you specify.  I was hoping it would give the details directly without needing to click on the "Products" link.
Dear Steve,

I got this to work like this:

{Products action='details' viewdetailstemplate="sample" productid="1"}

where "sample" is the name of the detail template that you want to use

Let me know if it does the trick.

Regards

Ben
starbits
Forum Members
Forum Members
Posts: 47
Joined: Tue Oct 09, 2007 9:41 pm

Re: call a single product in products module

Post by starbits »

Congratulations Ben!  Nice job.  On my newer version, the tag works like this:
{Products action='details' detailtemplate="somename" productid="1"} 

Also I have now specified my own template as the default template, and once I did that, the tag works even without the "detailtemplate" option.

I guess the conclusion is that you cannot specify the action="details" until you have a new detail template of your own.  As far as I am concerned you can mark this as SOLVED.  Thanks for the help.

Steve
kurashiki_ben
Forum Members
Forum Members
Posts: 86
Joined: Sun Jul 05, 2009 2:37 am

Re: call a single product in products module

Post by kurashiki_ben »

starbits wrote: Congratulations Ben!  Nice job.  On my newer version, the tag works like this:
{Products action='details' detailtemplate="somename" productid="1"} 

Also I have now specified my own template as the default template, and once I did that, the tag works even without the "detailtemplate" option.

I guess the conclusion is that you cannot specify the action="details" until you have a new detail template of your own.  As far as I am concerned you can mark this as SOLVED.  Thanks for the help.

Steve
Thanks for the improved "final answer" :)

=> Solved
Post Reply

Return to “Modules/Add-Ons”