Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

No Image Show In Block Rate Topic   - - - - -

 

Posted 03 July 2019 - 09:46 AM #1

hi friends. i problem to show image in block.

i create a custom template for block Newest products:

pjtg_2019-07-03_14_05_14-design_layouts_

 

and create files in:

 

templates/addons/my_changes/blocks/products/custom_item.tpl:

{** block-description:new_product **}
{if $block.properties.hide_add_to_cart_button == "Y"}
    {assign var="_show_add_to_cart" value=false}
{else}
    {assign var="_show_add_to_cart" value=true}
{/if}
{assign var="_show_name" value="true"}
{include file="addons/my_changes/blocks/product_list_templates/new-product-grid.tpl"
products=$items 
no_sorting="Y" 
no_pagination="Y" 
obj_prefix="`$block.block_id`000" 
show_add_to_cart=$_show_add_to_cart}

templates/addons/my_changes/blocks/product_list_templates/new-product-grid.tpl:

{** template-description:new-product-grid **}

{include file="addons/my_changes/blocks/list_templates/new-product-grid.tpl"
show_name=true
show_sku=false
show_price=true
show_old_price=true
show_clean_price=true
show_add_to_cart=$show_add_to_cart|default:true
but_role="action"
hide_form=true
hide_qty_label=true
show_product_labels=false
show_discount_label=false
show_shipping_label=false
}

templates/addons/my_changes/blocks/list_templates/new-product-grid.tpl:

{if $products}

    {script src="js/tygh/exceptions.js"}

    {if !$no_pagination}
        {include file="common/pagination.tpl"}
    {/if}

    {if !$no_sorting}
        {include file="views/products/components/sorting.tpl"}
    {/if}

    {assign var="image_width" value=$image_width|default:278}
    {assign var="image_height" value=$image_height|default:173}

    <div class="ty-compact-list">
        {foreach from=$products item="product" key="key" name="products"}
            {assign var="obj_id" value=$product.product_id}
            {assign var="obj_id_prefix" value="`$obj_prefix``$product.product_id`"}
            {include file="common/product_data.tpl" product=$product}
            {hook name="products:product_compact_list"}
                <div class="ty-compact-list__item">
                    <form {if !$config.tweaks.disable_dhtml}class="cm-ajax cm-ajax-full-render"{/if} action="{""|fn_url}" method="post" name="short_list_form{$obj_prefix}">
                        <input type="hidden" name="result_ids" value="cart_status*,wish_list*,account_info*" />
                        <input type="hidden" name="redirect_url" value="{$config.current_url}" />
                        <div class="ty-compact-list__content">
                            <div class="ty-compact-list__image">
                                <a href="{"products.view?product_id=`$product.product_id`"|fn_url}">
                                    {include file="common/image.tpl" image_width=$image_width image_height=$image_height images=$product.main_pair obj_id=$obj_id_prefix}
                                </a>
                                {assign var="product_labels" value="product_labels_`$obj_prefix``$obj_id`"}
                                {$smarty.capture.$product_labels nofilter}
                            </div>
                            
                            <div class="ty-compact-list__title">
                                {assign var="name" value="name_$obj_id"}<bdi>{$smarty.capture.$name nofilter}</bdi>

                                {$sku = "sku_`$obj_id`"}
                                {$smarty.capture.$sku nofilter}

                            </div>

                            <div class="ty-compact-list__controls">
                                <div class="ty-compact-list__price">
                                    {assign var="old_price" value="old_price_`$obj_id`"}
                                    {if $smarty.capture.$old_price|trim}
                                        {$smarty.capture.$old_price nofilter}
                                    {/if}

                                    {assign var="price" value="price_`$obj_id`"}
                                    {$smarty.capture.$price nofilter}

                                    {assign var="clean_price" value="clean_price_`$obj_id`"}
                                    {$smarty.capture.$clean_price nofilter}
                                </div>

                                {if !$smarty.capture.capt_options_vs_qty}
                                    {assign var="product_options" value="product_options_`$obj_id`"}
                                    {$smarty.capture.$product_options nofilter}

                                    {assign var="qty" value="qty_`$obj_id`"}
                                    {$smarty.capture.$qty nofilter}
                                {/if}

                                {if $show_add_to_cart}
                                    {assign var="add_to_cart" value="add_to_cart_`$obj_id`"}
                                    {$smarty.capture.$add_to_cart nofilter}
                                {/if}
                                <div class="list-countr list-bookmark">
                                    <span class="list-country">England</span>
                                    
                                    <span id="wrap_button_wishlist_62" class="button-submit button-wrap-left">
                                        <span class="button-submit button-wrap-right">
                                            <button type="submit" id="button_wishlist_62" class="button-submit-big btn-bookmark" name="dispatch[wishlist.add..62]"><i class="icon icon-bookmark"></i></button>
                                        </span>  
                                    </span>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            {/hook}
        {/foreach}
        
        <div class="clearfix"></div>
        <div><a class="new-gallery-see-all">see all</a></div>
    </div>
    
    

{if !$no_pagination}
    {include file="common/pagination.tpl" force_ajax=$force_ajax}
{/if}

{/if}

but not show image:

ttdm_2019-07-03_14_15_57-horn_company.pn

 

please help me. tanx.



 

Posted 11 July 2019 - 04:50 AM #2

pleaseeeee help me.. pleaseeeeee



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19456 posts

Posted 11 July 2019 - 06:11 AM #3

You should extend the app/schemas/block_manager/templates.php schema to add fn_gather_additional_products_data function as bulk modifier for your template.

 

Use current schema of product templates as example


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 

Posted 13 July 2019 - 12:50 PM #4

You should extend the app/schemas/block_manager/templates.php schema to add fn_gather_additional_products_data function as bulk modifier for your template.

 

Use current schema of product templates as example

Thank you very much!
I really appreciate your help... :wub: :wub: :wub: :oops:



 

Posted 13 July 2019 - 01:48 PM #5

You should extend the app/schemas/block_manager/templates.php schema to add fn_gather_additional_products_data function as bulk modifier for your template.

 

Use current schema of product templates as example

Excuse me, can you answer one of my other questions?

in design / layouts / homepage...

in content:

I created two grids. And I created a block in each of the grids.
For newest products.
But when the template changes one, the other block changes like that one.
In fact, because of the use of newest products in content twice, one can not give each one a separate template. How can I fix this problem?



 

Posted 13 July 2019 - 01:51 PM #6

Thank you very much!
I really appreciate your help... :wub: :wub: :wub: :oops:

I want to use the shortlist template for the first block and in the second block from the grid template. But this is not possible.



 

Posted 13 July 2019 - 02:13 PM #7

I want to use the shortlist template for the first block and in the second block from the grid template. But this is not possible.

I do not know English! But it's best to look at the picture below to better understand this question.

thanks.

2019_07_13_18_27_13_Design_Layouts_Admin



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19456 posts

Posted 15 July 2019 - 05:47 AM #8

It looks like a bug. Different templates can be used with the same filling type. Try to reproduce the issue on the demo website

 

https://demo.cs-cart.com/admin.php


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.