I have the following code in my products page template:
I have the following code in my products page template:
At first, please try to replace
with
Then clear cache and check the result
Unfortunately it did not work. The odd thing is that I have the product price and it updates beautifully when the size is changed.
Here is the code to the template. This is my custom template to display all products available. I appreciate your help.
{* $Id: cat_grid_options_list.tpl 11423 2010-12-20 08:52:19Z alexions $ *}{if $products}
{math equation=“100 / x” x=$columns|default:“2” assign=“cell_width”}
{if $item_number == “Y”}
{assign var=“cur_number” value=1}
{/if}{* FIXME: Don’t move this file *}
{script src=“js/tygh/product_image_gallery.js”}{if $settings.Appearance.enable_quick_view == ‘Y’}
{$quick_nav_ids = $products|fn_fields_from_multi_level:“product_id”:“product_id”}
{/if}{if $subcategories or $category_data.description || $category_data.main_pair} {math equation="ceil(n/c)" assign="rows" n=$subcategories|count c=$columns|default:"2"} {split data=$subcategories size=$rows assign="splitted_subcategories"}{if $category_data.description && $category_data.description != “”}
{$category_data.description|unescape}
{/if}{if $subcategories} {foreach from=$splitted_subcategories item="ssubcateg"} {foreach from=$ssubcateg item=category name="ssubcateg"} {if $category.category_id}{/if}{$category.category}
{if !$show_empty}
{split data=$products size=$columns|default:“2” assign=“splitted_products”}
{else}
{split data=$products size=$columns|default:“2” assign=“splitted_products” skip_complete=true}
{/if}{script src=“js/addons/my_changes/firstword.change.js”}
{/if} {/foreach} {/foreach} {/if}
{strip}
{foreach from=$products item=“product” key=“key” name=“products”}
{if $category.category_id==$product.main_category}
{assign var=“obj_id” value=$product.product_id}
{assign var=“obj_id_prefix” value=“$obj_prefix``$product.product_id
”}
{/if} {/foreach} {/strip}
{if $product}
{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}
{assign var="form_open" value="form_open_`$obj_id`"} {$smarty.capture.$form_open nofilter} {hook name="products:product_multicolumns_list"}{/if}{if $item_number == "Y"} {$cur_number}. {math equation="num + 1" num=$cur_number assign="cur_number"} {/if} {assign var="name" value="name_$obj_id"} {$smarty.capture.$name nofilter}Product Details{include file="views/products/components/product_icon.tpl" product=$product show_gallery=true} {assign var="discount_label" value="discount_label_`$obj_prefix``$obj_id`"} {$smarty.capture.$discount_label nofilter}{/if} {assign var="rating" value="rating_$obj_id"} {if $smarty.capture.$rating} {/if} {/hook} {assign var="form_close" value="form_close_`$obj_id`"} {$smarty.capture.$form_close nofilter}CODE:{$product.product_code}
{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="list_discount" value="list_discount_`$obj_id`"} {$smarty.capture.$list_discount nofilter} {assign var="clean_price" value="clean_price_`$obj_id`"} {$smarty.capture.$clean_price nofilter}{capture name=“mainbox_title”}{$category_data.category}{/capture}
{if !$no_pagination}
{include file=“common/pagination.tpl” force_ajax=$force_ajax}
{/if}{/if}
It is required to examine issue on your server. I do not see any issues in your code
It seems to me it might be some sort of permission or something not found on that page.
This is part of the ajax call that updates when the size is changed:
$.ceAjax('request', url, { result_ids: update_ids.join(',').toString(), caching: cache_query, force_exec: true, pre_processing: fn_pre_process_form_files, callback: function(data, params) { fn_post_process_form_files(data, params); var parents = $('.cm-reload-' + obj_id); $.each(parents, function(id, parent_elm) { if (data.html && data.html[$(parent_elm).prop('id')]) { var reload_id = $(parent_elm).prop('id'), elms = $(':input', parent_elm), checked_elms = [];
The script does find the cm-reload in the page, but when it checks if there is a value returned by the ajax call, then that element comes through null on this if statement:
if (data.html && data.html[$(parent_elm).prop(‘id’)]) {
Why wouldn't it return the new image and code, but it does return the price for that product?
Found the issue, of course it was simple now that it's fixed. Hopefully this will help others.
In admin panel, go to design templates and in your options file for you custom template, make sure you have the right options enabled. In my case they were:
{include file="addons/my_changes/blocks/list_templates/cat_grid_options_list.tpl" show_name=false details_page=true show_product_amount=true show_qty=true show_sku=true show_trunc_name=true show_old_price=true show_price=true show_rating=true show_clean_price=true show_list_discount=true show_add_to_cart=true show_product_options=true but_role="action" show_discount_label=true}