Page 1 of 1
[solved] call a single product in products module
Posted: Wed Aug 12, 2009 7:18 am
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
Re: call a single product in products module
Posted: Wed Oct 28, 2009 11:39 pm
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
Re: call a single product in products module
Posted: Wed Oct 28, 2009 11:52 pm
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.
Re: call a single product in products module
Posted: Sat Oct 31, 2009 4:21 am
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
Re: call a single product in products module
Posted: Sun Nov 01, 2009 10:38 am
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
Re: call a single product in products module
Posted: Mon Nov 02, 2009 2:54 pm
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
Re: call a single product in products module
Posted: Tue Nov 03, 2009 7:27 am
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