Search code examples
templatesproducttyposcripttypo3-6.2.x

TYPO3 tt_products (shop) link item in basket to its single item page


straight to the point:

I'm on TYPO3 6.2.19 using tt_products 2.7.18. Via the marker <!--###LINK_ITEM###--> wrapped around anything I get the link to the products detail page.

I use <!--###LINK_ITEM###-->###PRODUCT_IMAGE###<!--###LINK_ITEM###--> in the item-list template which renders as:

<a href="shop/details/my-fancy-item/">
    <img src="typo3temp/_processed_/csm_my-fancy-item_86ffae0e91.png" width="100" height="100" alt="My Fancy Item">
</a>

But the same code as above used in the basket template renders as:

<a href="shop/details/my-fancy-item/?tt_products%5Bvariants%5D=;;;;;;;;;"></a>
<a href="index.php?eID=tx_cms_showpic&amp;file=319&amp;md5=2b3e59e2f659d5b113dac427953503831ed067e9&amp;parameters%5B0%5D=YTozOntzOjU6IndpZHRoIjtzOjM6IjU1MCI7czo3OiJib2R5VGFnIjtzOjg0OiI8&amp;parameters%5B1%5D=Ym9keSBiZ0NvbG9yPSJibGFjayIgbGVmdG1hcmdpbj0iMCIgdG9wbWFyZ2luPSIw&amp;parameters%5B2%5D=IiBtYXJnaW53aWR0aD0iMCIgbWFyZ2luaGVpZ2h0PSIwIj4iO3M6NDoid3JhcCI7&amp;parameters%5B3%5D=czozNzoiPGEgaHJlZj0iamF2YXNjcmlwdDpjbG9zZSgpOyI%2BIHwgPC9hPiI7fQ%3D%3D" onclick="openPic('http://my.domain.de/index.php?eID=tx_cms_showpic&amp;file=319&amp;md5=2b3e59e2f659d5b113dac427953503831ed067e9&amp;parameters%5B0%5D=YTozOntzOjU6IndpZHRoIjtzOjM6IjU1MCI7czo3OiJib2R5VGFnIjtzOjg0OiI8&amp;parameters%5B1%5D=Ym9keSBiZ0NvbG9yPSJibGFjayIgbGVmdG1hcmdpbj0iMCIgdG9wbWFyZ2luPSIw&amp;parameters%5B2%5D=IiBtYXJnaW53aWR0aD0iMCIgbWFyZ2luaGVpZ2h0PSIwIj4iO3M6NDoid3JhcCI7&amp;parameters%5B3%5D=czozNzoiPGEgaHJlZj0iamF2YXNjcmlwdDpjbG9zZSgpOyI%2BIHwgPC9hPiI7fQ%3D%3D','6a8dba3c3d42a166bb85c59d20947e19','width=550,height=550,status=0,menubar=0'); return false;" target="thePicture">
    <img src="typo3temp/_processed_/csm_my-fancy-item_b631da6007.png" width="26" height="26" alt="">
</a>

... and I can't figure out why it's behaving different.

I want the same rendered content in the basket as it's rendered in the item-list (except for the image dimensions). Is there a typoscript configuration I missed? Can somebody please help me with it?

Thanks in advance and have a nice day.     :)


Solution

  • The link from the basket view to the single view also provides all the product's variants information. The color and the size of a product is connected to the product in the basket. This information (color, size and other variants) will be forwarded to the product single view. Then the product single view will only show the product together with the variants. If you want to change this behaviour, then you must adapt the PHP code of tt_products.

    class.tx_ttproducts_basket_view.php;

    if (is_array($extArray) && is_array($extArray[$basket->getFuncTablename()])) { $addQueryString['variants'] = htmlspecialchars($extArray[$basket->getFuncTablename()][0]['vars']); }

    You can comment you the lines above. However then you won't see the product in the same variants as you have it in the basket.