A simple way to add any content on any place on template

I’m here and waiting also :grin:

Ajax is doing the mess, on request blocks for the products.view are not generated and the capture cannot be created, but this will depend were you add [color=#ff0000]{$smarty.capture.infotext}[/color] in default_template.tpl



[color=#ff0000]wrong:[/color]

<br />
  {if !$no_images}<br />
   <div class="image-border float-left center cm-reload-{$product.product_id}" id="product_images_{$product.product_id}_update"><br />
	{include file="views/products/components/product_images.tpl" product=$product show_detailed_link="Y"}<br />
   {$smarty.capture.infotext}<!--product_images_{$product.product_id}_update--></div><br />
  {/if}<br />

```<br />
<br />
[color=#006400]correct:[/color]<br />
<br />
```php
<br />
  {if !$no_images}<br />
   <div class="image-border float-left center cm-reload-{$product.product_id}" id="product_images_{$product.product_id}_update"><br />
	{include file="views/products/components/product_images.tpl" product=$product show_detailed_link="Y"}<br />
   <!--product_images_{$product.product_id}_update--></div>{$smarty.capture.infotext}<br />
  {/if}<br />

```<br />
<br />
@Tina please PM the link to the website and i will try to help<br />
<br />
---<br />
Valentin

Dear Valentin;

Do we let pm message :)

We wait you. :grin:

@crazyshark20

did you try my last post with the correct position of [color=#ff0000]{$smarty.capture.infotext} [/color]?

In order to format the capture wrapper identical to my sidebox_general wrapper I edited the contents of the capture.tpl to this:


```php

{if $block.user_class}{capture name=$block.user_class}



{hook name="wrapper:sidebox_general_title"}
{if $smarty.capture.title|trim}
{$smarty.capture.title}
{else}
{$title}
{/if}
{/hook}


{$content|unescape|default:" "}


{/capture}
{/if}
```

This way I didn't have to actually create any new CSS classes for the capture wrapper. I additionally set the width of the sidebox right in the wrapper's template. Then the CSS class defined for the block is just a value used for the smarty.capture function and is not an actual CSS class. I did this because I didn't have a footer_right class, or other appropriate CSS class - and didn't want to build all that was necessary from scratch, when it was already all available in my sidebox_general wrapper.

This has been a very handy method for adding [url="http://forum.cs-cart.com/topic/31236-free-addon-newest-products-from-same-category-on-product-details-page/page__fromsearch__1"]this addon[/url] from Vali to the Main Content of my products, while keeping my product pages in the full grid_16 display.

Update for cs-cart 4.x with one store,


  1. only the file location is changed [color=#ff0000]design/themes/[SKIN_NAME]/templates/addons/my_changes/blocks/wrappers/capture.tpl[/color] the code inside the tpl is the same

    2, 3 the same





    Valentin

    [color=#808080][size=2]part of hungryweb.net[/size][/color]

Vali,



Probably stupid question but in your example screen shots you have options and 'Add To Cart' button very tight below price with 'Colour' and 'Product Description' text shown just below (plus product tabs). Is this just a template mod to achieve this on the basic skin? I am making various improvements & fine tuning 'down the line' and would like to emulate this 'tighter' layout…



Many thanks

I know this post is a few months old, but I had been searching for a way to do this and this is spot on, thanks.



But, I'm having some problems. I can get the smarty content to show up where I want on my Product Details page, but it is being rendered with all of the HTML tags showing. I added 'nofilter' to the smarty tag ({$smarty.capture.test_block nofilter}) which helped get rid of some of the tags, but now it's showing

my content here
on the page.



The source code shows:
my content here
and doesn't render the stylesheet at all either. I can get around that by adding a div with the style in the template page, but it still shows the wysiwyg div tag.



I've tried making the block HTML and HTML with Smarty support but can't get it to display properly. Any ideas on how to work around this? Would really appreciate any help.

I want to display addon product analogues the way you say. I tried a bit on my own but I can't manage it to display. Any chance of a little help? v 3.0.6

Thank you in advance

I spent 2 days until I found this post, thank you very much.

A little note, I named my class “before-product-tabs”, it didn't work, I changed to “before_product_tabs”, it worked. (cs-cart 4.2.4)

You have just made my life so much easier with this tip!!! It worked flawlessly and was so simple. I have been searching for days for a way to be able to insert the contents of another block into the middle of the main content block on the product detail page, and I finally happened to hit upon the right search phrase to find your post! Thank you!

Colleen

Did anyone manage to get product features display in a block?
We have it in a tab but now that everyone is on mobile, no one clicks the tab. If would like to display product features on the main product details page, below the product description text.

Did anyone manage to get product features display in a block?
We have it in a tab but now that everyone is on mobile, no one clicks the tab. If would like to display product features on the main product details page, below the product description text.

We jave developed an addon that can show features direct below description. It looks like you wrote it in the description.

So you can choose from each feature to show in tab or under description

The price is 30€ if you want to buy it.Just let me know your version as I might need to upgrade it for you.

Fotis

We jave developed an addon that can show features direct below description. It looks like you wrote it in the description.

So you can choose from each feature to show in tab or under description

The price is 30€ if you want to buy it.Just let me know your version as I might need to upgrade it for you.

Fotis

Do you have a demo Fotis or at least a link to your product ?

Do you have a demo Fotis or at least a link to your product ?


Let me have a look tommorow where do we have this and i will post it here as it was a custom work.

Fotis

Ok found it on our demo


http://ez-cart.com/cs424/electronics/tv-and-video/led-tvs/40-class-40.0-diag.-led-5003-series-tv/


See below the description.


You just need to select from feature settings if Its going to show in tab or below description

We also have a more advanced Addon that shows the features with icons and popup text below description


See this


https://www.led-electro.gr/led-sfairiki-leuko-mat-g45-economy-e14-5w-me-led-smd-chip-2835-leuko-fos-4000k.html

Did anyone manage to get product features display in a block?
We have it in a tab but now that everyone is on mobile, no one clicks the tab. If would like to display product features on the main product details page, below the product description text.

Go to Design -> Layouts -> Products page and create HTML block with SMARTY support and the following code

{include file="views/products/components/product_features.tpl" product_features=$product.product_features details_page=true}

Enjoy

pls see attached screenshot,

sometimes it works and sometimes not.

what could it be ?

filtersa.JPG

i have done a screen recorder.

https://youtu.be/qF2H_S3IAUY

https://youtu.be/qF2H_S3IAUY

i can't explain why