Jump to content

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

Refresh Tabs On Product Option Change Rate Topic   - - - - -

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11384 posts

Posted 07 November 2019 - 01:45 AM #1

Is there a way to refresh a tab that is based on a block when a product option is changed?

I have data that is based on product_code for display.  But when a product_option is displayed, the block is not redrawn.

 

I have a html/smarty block that has code to display data based on what the product code of the product is.  If page is loaded with ABC-S (small) if I change the option to large, the product_code changes to ABC-L but the block is not re-rendered so it can pick up the data for the correct product code.

 

Is there a block option or something else I can do to have it re-rendered when the product options are changed?


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11384 posts

Posted 08 November 2019 - 11:36 PM #2

I moved this from a tab to a standard hook for the product.details page. I have JS that extends the value of the result_ids for the form associated with the option selector to append 'my_div' to it so it becomes: "<input type="hidden" name="result_ids" value="cart_status*,wish_list*,checkout*,account_info*,abt__youpitheme_wishlist_count,my_div">"

 

I have my block of code as:

<div id="my_div">
  <script type="text/javascript" data-no-defe>console.log("Rendering my_div");r</script>
  <div class="control-group">
    <!-- html code goes here -->
  </div>
<!--my_div--></div>

However, when the option is changed, the console log and the data show that the block has not been re-rendered.

 

It's critical for my work that I can get the div to re-render when the option is changed.  The product_code and the option are both updated when a different option is selected.  The data I display is in an array that is indexed by product_code.  Hence when the product code changes I should be displaying the information related to the product_code (which could be none or an unordered list).


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


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

Posted 11 November 2019 - 05:40 AM #3

Try to add cm-ajax-force class on the script tag


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 руб.


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11384 posts

Posted 11 November 2019 - 09:59 PM #4

Unfortunately makes no difference.  Any other suggestions?  I do notice that when changing the option, the request goes to yotpo.com versus the site url.  So I'm going to assume this is a theme issue, not a site issue.

 

Thanks for the suggestion.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.