Start a new topic

API endpoints /shop/get_offer_table

I have a site using the volume and tiered discount app. I have the pro version so that I am able to give different quantity discounts for each variant. There is a nifty table displayed for the quantity discounts on the product page. Trouble is, the little table does not update as variants change. 

By looking into the app code I found an ajax call being made to an endpoint
/shop/get_offer_table. The URL is actually window.hulkapps.vd_url+"/shop/get_offer_table"

and some data gets passed to it: 

    if(window.hulkapps.customer){

     data = {

          pid: window.hulkapps.product_id,

          store_id: window.hulkapps.store_id,

          ctags: window.hulkapps.customer.tags,

          product_variants: window.hulkapps.product_variants,

          product_collections: window.hulkapps.product_collections

        }

    }else{

     data = {

          pid: window.hulkapps.product_id,

          store_id : window.hulkapps.store_id,

          product_variants: window.hulkapps.product_variants,

          product_collections: window.hulkapps.product_collections

        }

    }

  I would like to hit this endpoint each time the variants change so that I can make sure the table is updated to match the displayed variant, for some reason, no matter what data I pass to the endpoint, the same (or sometimes a totally unrelated table) gets returned.

How is this endpoint supposed to work?


1 person has this question
1 Comment

I'm also trying to achieve the same thing, I'm assuming you didn't find a way around this?


I've got my own AJAX call to update my product page when the user changes the variant but like you've pointed out I can only retrieve the 'parent' level product table.

Login or Signup to post a comment