Last edited by Calljj; 14 Jan 2019 at 10:57 AM.
Looks like some troubleshooting is necessary. Would suggest first seeing what if anything is logged in the console (F12 and then review what is essentially a debug screen or often called a console). Then assuming that the jscript_ file for the product type in question is up-to-date, would set a breakpoint in the javascript (shown to have loaded because of the issues involved), modify a an attribute selection and follow the javascript to see that it goes to completion. As part of that at least looking at the results to be presented to the page. If see that new text is to be provided, but it isn't updated, to then verify that the html object(s) to be updated are in the page's source code.
The next thing to think of is the settings for the applicable attributes as to include the price(s) in the pricing. This could be done at any point in the above checks.
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
So the response given in the console is changing every time i make a change in atttribute selection...
Code:responseText: "\r\n\ufeff{\"responseType\":\"success\",\"data\":{\"priceTotal\":\"<font size=\\\"0.5\\\" color=\\\"#636363\\\">Price: <\\/font>£1,459.00\",\"preDiscPriceTotalText\":\"<font size=\\\"0.5\\\" color=\\\"#636363\\\">Price: <\\/font>\",\"preDiscPriceTotal\":\"£1,215.83\",\"stock_quantity\":\"1\",\"weight\":\"7\"}}"and the area on the page productPrices is displayed in is refreshing... i.e spinning wheel and then displaying a price... its just that it's still the original price. so not showing the changes given in the response...Code:responseText: "\r\n\ufeff{\"responseType\":\"success\",\"data\":{\"priceTotal\":\"<font size=\\\"0.5\\\" color=\\\"#636363\\\">Price: <\\/font>£1,209.00\",\"preDiscPriceTotalText\":\"<font size=\\\"0.5\\\" color=\\\"#636363\\\">Price: <\\/font>\",\"preDiscPriceTotal\":\"£1,007.50\",\"stock_quantity\":\"1\",\"weight\":\"7\"}}"
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
ok, seems to fail within the jscript_dynamic_price_updater.php
when approx line 139, makes a call to
which my result goes toCode:zcJS.ajax(option).done{
Code:.fail( function(jqXHR,textStatus,errorThrown) {
Changing code to
gives:Code:.fail( function(jqXHR,textStatus,errorThrown) { alert(errorThrown);
SyntaxError: JSON.parse: unexpected character at line 2 column 1 of the JSON data
Last edited by Calljj; 17 Jan 2019 at 01:47 PM.
then showing the JSON gives:
Code:{"XML":"securityToken=468ca6253914efa9633b14fdd8368a21&id[1]=2&id[2]=97&id[32]=292&cart_quantity=1&products_id=8902&pspClass=productGeneral&stat=main&outputType=XML","JSON":{"securityToken":"468ca6253914efa9633b14fdd8368a21","id[1]":"2","id[2]":"97","id[32]":"292","cart_quantity":"1","products_id":"8902","pspClass":"productGeneral","stat":"main","outputType":"JSON"}}
Last edited by Calljj; 17 Jan 2019 at 02:07 PM.
Something doesn't look right about that returned "JSON", if the includes/classes/dynamic_price_updater.php file of the current version were in place then only either XML **OR** JSON would be returned not both.
Here is the JSON response I get when using firefox on ZC default demo product index.php?main_page=product_info&cPath=54_56&products_id=159:
Now there is a little extra data sent back as I am trying to work on the "middle" price display for a product that would display three different prices if has say a special and a sale.Code:{"responseType":"success","data":{"sideboxContent":"<span class=\"DPUSideBoxName\">Base price<\/span><span class=\"DPUSideboxQuantity\"> x 0<\/span> ($33.00)<br \/><span class=\"DPUSideBoxName\">Yellow<\/span><span class=\"DPUSideboxQuantity\"> x 1<\/span> ($0.00)<br \/><hr \/><span class=\"DPUSideboxTotalText\">Total: <\/span><span class=\"DPUSideboxTotalDisplay\">$33.00<\/span>","priceTotal":"Sale: $33.00","preDiscPriceTotalText":"Sale: ","midDiscPriceTotal":"$35.50","preDiscPriceTotal":"$35.50","stock_quantity":"10000","weight":"1"}}
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
This is the function in question at the end of the file:
$data is an array that is created in the function, $this->responseText is populated throughout the class, but it contains only the key/response information captured throughout the process and XML is not at all captured in that process from what I see of the file. The die at the end of each if statement is present to prevent processing any further information.Code:/* * Formats the response and flushes with the appropriate headers * This should be called last as it issues an exit * * @return void */ protected function dumpOutput($outputType = "XML") { if ($outputType == "XML") { // output the header for XML header("content-type: text/xml"); // set the XML file DOCTYPE echo '<?xml version="1.0" encoding="UTF-8" ?>' . "\n"; // set the responseType echo '<root>' . "\n" . '<responseType>' . $this->responseType . '</responseType>' . "\n"; // now loop through the responseText nodes foreach ($this->responseText as $key => $val) { echo '<responseText' . (!is_numeric($key) && !empty($key) ? ' type="' . $key . '"' : '') . '><![CDATA[' . $val . ']]></responseText>' . "\n"; } die('</root>'); } elseif ($outputType == "JSON") { $data = array(); // output the header for JSON header('Content-Type: application/json'); // DO NOT set a JSON file DOCTYPE as there is none to be included. // echo '<?xml version="1.0" encoding="UTF-8" ' . "\n"; // set the responseType $data['responseType'] = $this->responseType; // now loop through the responseText nodes foreach ($this->responseText as $key => $val) { if (!is_numeric($key) && !empty($key)) { $data['data'][$key] = $val; } } die(json_encode($data)); } }
Is an older version or mix of files being used for some reason?
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...