But I want to ensure only products with images in shown and not the variants e.g. Product A1 - Blue... just Product A1.. futhermore I have a problem with showing the price, where I have used the code from product page.
<xsl:template match="*" mode="productprice"> <xsl:variable name="currentCurrency" select="teacommerce:GetCurrentCurrency()"/> <xsl:variable name="variant" select="./descendant-or-self::Product [not(child::Product)][1]"/> <!-- The product stock is fetched from either the product or the first variant --> <xsl:variable name="stock" select="teacommerce:GetStock($variant)" /> <!-- The product prices is fetched in all currencies --> <xsl:variable name="prices" select="teacommerce:GetPrices($variant)" /> <xsl:variable name="priceUnFormatted" select="$prices/* [name() = $currentCurrency/@ISOCode]/@price" /> <!-- The product price with the current currency and formatted with the current culture --> <xsl:variable name="price" select="teacommerce:FormatPriceWithSpecificCulture($priceUnFormatted, $currentCurrency/@cultureName)" />
For the random products - I think I would go for a multi tree node picker from uComponents and have the shop owner select which products to get "random" from. The often know which products sell the best and which one the want to highlight - it shouldnt be true random. Now you will have a list of ids to choose from - and then its just plain old Tea Commerce as you know it. Get the product xml by id and do your magic :)
Yes, I was thinking if it should be complete random product or the shop owner should pick one.. I was exploring with the complete random product as I did with random quotes on http://oldengaard.dk ... but it would probably be better with a selected product by the shop owner, so it could be a best selling product, an offer or just a product they want to hightligt...
If it should be really fancy the code would be more advanced and automatically select e.g. one of the top ten best selling product or one of the offers ... so the shop owner has three options: show best selling products, offers or pick a product.
Get random product
Hi..
I am trying to get a random product to be shown on frontpage: http://sub.ak-security.dk/da/forside.aspx
But I want to ensure only products with images in shown and not the variants e.g. Product A1 - Blue... just Product A1.. futhermore I have a problem with showing the price, where I have used the code from product page.
Bjarne
Hi Bjarne
For the random products - I think I would go for a multi tree node picker from uComponents and have the shop owner select which products to get "random" from. The often know which products sell the best and which one the want to highlight - it shouldnt be true random. Now you will have a list of ids to choose from - and then its just plain old Tea Commerce as you know it. Get the product xml by id and do your magic :)
Kind regards
Anders
Hi Anders
Yes, I was thinking if it should be complete random product or the shop owner should pick one.. I was exploring with the complete random product as I did with random quotes on http://oldengaard.dk ... but it would probably be better with a selected product by the shop owner, so it could be a best selling product, an offer or just a product they want to hightligt...
If it should be really fancy the code would be more advanced and automatically select e.g. one of the top ten best selling product or one of the offers ... so the shop owner has three options: show best selling products, offers or pick a product.
I will try with the more simple solution .. :)
Bjarne
Yes it could be way more advanced - but true to keep it simple sometimes is enough :)
Dint forget to mark the right answer as the solution :)
is working on a reply...