CartThrob / MailingLists

Allows you to add customer to one or more Campaign Monitor or Mailchimp email lists during checkout
4 stars 1 forks source link

Change generate_json to json_encode #2

Open neilbradley opened 8 years ago

neilbradley commented 8 years ago

In lines 1608 - 1617 of the Mbr_addon_builder.php, it errors with the generate_json parts;

'.(isset($channel_titles) ? "channels: ".$this->EE->javascript->generate_json($channel_titles).',' : NULL).'
'.(isset($product_channel_titles) ? "product_channels: ".$this->EE->javascript->generate_json($product_channel_titles).',' : NULL).'
'.(isset($fields) ? "fields: ".$this->EE->javascript->generate_json($fields).',' : NULL).'
'.(isset($product_channel_fields) ? "product_channel_fields: ".$this->EE->javascript->generate_json($product_channel_fields).',' : NULL).'
'.(isset($order_channel_fields) ? "order_channel_fields: ".$this->EE->javascript->generate_json($order_channel_fields).',' : NULL).'
'.(isset($status_titles) ? "statuses: ".$this->EE->javascript->generate_json($status_titles).',' : NULL).'
'.(isset($templates) ? "templates: ".$this->EE->javascript->generate_json($templates).',' : NULL).'
'.(isset($states) ? "states: ".$this->EE->javascript->generate_json($states).',' : NULL).'
'.(isset($countries) ? "countries: ".$this->EE->javascript->generate_json($countries).',': NULL).'
'.(isset($states_and_countries) ? "statesAndCountries: ".$this->EE->javascript->generate_json($states_and_countries).',' : NULL).'

It now needs to read as;

'.(isset($channel_titles) ? "channels: ".json_encode($channel_titles).',' : NULL).'
'.(isset($product_channel_titles) ? "product_channels: ".json_encode($product_channel_titles).',' : NULL).'
'.(isset($fields) ? "fields: ".json_encode($fields).',' : NULL).'
'.(isset($product_channel_fields) ? "product_channel_fields: ".json_encode($product_channel_fields).',' : NULL).'
'.(isset($order_channel_fields) ? "order_channel_fields: ".json_encode($order_channel_fields).',' : NULL).'
'.(isset($status_titles) ? "statuses: ".json_encode($status_titles).',' : NULL).'
'.(isset($templates) ? "templates: ".json_encode($templates).',' : NULL).'
'.(isset($states) ? "states: ".json_encode($states).',' : NULL).'
'.(isset($countries) ? "countries: ".json_encode($countries).',': NULL).'
'.(isset($states_and_countries) ? "statesAndCountries: ".json_encode($states_and_countries).',' : NULL).'