Jump to content

Using Json to pass variables to JS in the Cart summary


Recommended Posts

Hello,

 

I know that PS uses Json to recive the variables from controllers. For example in cart-summary.js there is:

		$.ajax({
			type: 'POST',
			headers: { "cache-control": "no-cache" },
			url: baseUri + '?rand=' + new Date().getTime(),
			async: true,
			cache: false,
			data: 'controller=cart&ajax=true&allowSeperatedPackage=true&value='
				+ ($(this).prop('checked') ? '1' : '0')
				+ '&token='+static_token
				+ '&allow_refresh=1',
			success: function(jsonData)
			{
				//some functions...
			}

I belive that the variables / arrays are pass from the cart,php. My question is which function / method in cart.php is responsible for passing the data ?

 

Tip: there is now jsonEncode or echo in the cart.php

 

My purpose is the pass some variables to cart-summary.js from the other controller.

 

Thanks for help.

Link to comment
Share on other sites

×
×
  • Create New...