Hey guys,
I want to display the product price in the product page twice (also in the options section)
I duplicated the price code in big_picture.tpl but after I select an option with additional cost ONLY THE FIRST PRICE updates through ajax. The second one remains like the first load of the page. I checked and it gets the cm-reload tag but with no success.
Any idea how to make the second price update like the first one?
Thanks,
Alex
Hey guys,
I want to display the product price in the product page twice (also in the options section)
I duplicated the price code in big_picture.tpl but after I select an option with additional cost ONLY THE FIRST PRICE updates through ajax. The second one remains like the first load of the page. I checked and it gets the cm-reload tag but with no success.
Any idea how to make the second price update like the first one?
Thanks,
Alex
Try to use another ID for the corresponding div. Looks like IDs are duplicated and it causes the issue
SDAD
December 8, 2015, 12:00am
#3
IDs for reloading div's should be different. Please check it.
And it should be ended with before closing
alexandru, if you share the URL of the page with issue, we can check if it contains duplicated IDs
Hello,
The link is http://dev.digitalninja.ro/dormitor-primavera-3-usi-culisante-140cm.html
the div that is not updateing is called ty-product-block__price-actual2
The content of big_pickture.tpl is as follows:
{script src="js/tygh/exceptions.js"}
{hook name="products:view_main_info"}
{if $product}
{assign var="obj_id" value=$product.product_id}
{include file="common/product_data.tpl" product=$product but_role="big" but_text=__("add_to_cart")}
{$product.product nofilter}
{hook name="products:main_info_title"}{/hook}
{*
{if !$hide_title}
{/if}
{/hook}*}
{hook name="products:image_wrap"}
{if !$no_images}
{include file="views/products/components/product_images.tpl" product=$product show_detailed_link="Y" thumbnails_size=95}
{/if}
{/hook}
{/if}
{hook name="products:brand"}
{include file="views/products/components/product_features_short_list.tpl" features=$product.header_features feature_image=true}
{/hook}
{assign var="sku" value="sku_`$obj_id`"}{$smarty.capture.$sku nofilter}
Disponibilitate:
{if $product.product_features.9.variants}
{foreach from=$product.product_features.9.variants item="variante"}
{$variante.variant}
{/foreach}{/if}
Livrabilitate: {$product.livrabilitate} {* {$product|fn_print_r} *}
Configurator produs
{hook name="products:promo_text"}
{if $product.promo_text}
{$product.promo_text nofilter}
{/if}
{/hook}
{assign var="form_open" value="form_open_`$obj_id`"}
{$smarty.capture.$form_open nofilter}
{assign var="old_price" value="old_price_`$obj_id`"}
{assign var="price" value="price_`$obj_id`"}
{assign var="clean_price" value="clean_price_`$obj_id`"}
{assign var="list_discount" value="list_discount_`$obj_id`"}
{assign var="discount_label" value="discount_label_`$obj_id`"}
{if $smarty.capture.$price|trim}
Pret:
{$smarty.capture.$price nofilter}
{if $smarty.capture.$old_price|trim || $smarty.capture.$clean_price|trim || $smarty.capture.$list_discount|trim}
{if $smarty.capture.$old_price|trim}{$smarty.capture.$old_price nofilter}{/if}
{/if}
{if $smarty.capture.$old_price|trim || $smarty.capture.$clean_price|trim || $smarty.capture.$list_discount|trim}
{$smarty.capture.$clean_price nofilter}{$smarty.capture.$list_discount nofilter}
{/if}
{if $capture_options_vs_qty}{capture name="product_options"}{$smarty.capture.product_options nofilter}{/if}
{assign var="qty" value="qty_`$obj_id`"}
{$smarty.capture.$qty nofilter}
{assign var="min_qty" value="min_qty_`$obj_id`"}
{$smarty.capture.$min_qty nofilter}
{if $capture_options_vs_qty}{/capture}{/if}
{if $capture_buttons}{capture name="buttons"}{/if}
{/if}
{assign var="add_to_cart" value="add_to_cart_`$obj_id`"}
{$smarty.capture.$add_to_cart nofilter}
{assign var="list_buttons" value="list_buttons_`$obj_id`"}
{$smarty.capture.$list_buttons nofilter}
{hook name="products:product_detail_bottom"}
{/hook}
Configureaza produsul
{if $smarty.capture.$price|trim}
Pret:
{$smarty.capture.$price nofilter}
{/if}
{assign var="product_options" value="product_options_`$obj_id`"}
{$smarty.capture.$product_options nofilter}
{* {assign var="add_to_cart" value="add_to_cart_`$obj_id`"}
{$smarty.capture.$add_to_cart nofilter} *}
{if $capture_options_vs_qty}{/capture}{/if}
{if $capture_buttons}{/capture}{/if}
{/if}
{/hook}
{assign var="form_close" value="form_close_`$obj_id`"}
{$smarty.capture.$form_close nofilter}
{if $smarty.capture.hide_form_changed == "Y"}
{assign var="hide_form" value=$smarty.capture.orig_val_hide_form}
{/if}
{if $show_product_tabs}
{include file="views/tabs/components/product_tabs.tpl" product_details_in_tab="N"}
{if $blocks.$tabs_block_id.properties.wrapper}
{include file=$blocks.$tabs_block_id.properties.wrapper content=$smarty.capture.tabsbox_content title=$blocks.$tabs_block_id.description}
{else}
{$smarty.capture.tabsbox_content nofilter}
{/if}
{/if}
{* {assign var=“form_close” value=“form_close_$obj_id
”}
{$smarty.capture.$form_close nofilter} *}
{capture name=“mainbox_title”}{assign var=“details_page” value=true}{/capture}