{"id":16,"date":"2020-01-13T21:21:28","date_gmt":"2020-01-13T21:21:28","guid":{"rendered":"https:\/\/www.webgeneration.co.uk\/?p=16"},"modified":"2023-04-22T22:49:10","modified_gmt":"2023-04-22T21:49:10","slug":"integrating-product-price-by-size-with-attribute-wizard-pro","status":"publish","type":"post","link":"https:\/\/www.prestafusion.com\/blog\/integrating-product-price-by-size-with-attribute-wizard-pro","title":{"rendered":"Integrating Product Price By Size with Attribute Wizard Pro"},"content":{"rendered":"\n<p>If you&#8217;re using the Attribute Wizard Pro Module for Prestashop then you&#8217;ll soon find yourself running into problems with other modules which hook into Presashops cart functions.  This is because Attribute Wizard Pro overrides and hijacks some of the core Prestashop cart functions.<br><br>Although it is recommended to use the native Prestashop attributes \/ combinations when using the Product Price by Size module for maximum compatibility, if you do really need to use the two modules together this short guide should help you get the two running alongside each other.<br><br>The code references provided in this article correspond to Product Price By Size 1.5.4 and higher.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Modifying Attribute Wizard Pro Files<\/h2>\n\n\n\n<p>We&#8217;ll be modifying the following two files:<br><br><span class=\"filename\">\/modules\/attributewizardpro\/combination_json.php<\/span><br> <span class=\"filename\">\/modules\/attributewizardpro\/js\/awp_product.js<\/span> <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">combination_json.php<\/h3>\n\n\n\n<p>Locate the file: <span class=\"filename\">\/modules\/attributewizardpro\/combination_json.php<\/span> and comment the line at around 646:<br><br><\/p>\n\n\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\n$redirect = array(&quot;error&quot; =&gt; $errors, &quot;added&quot; =&gt; md5(stripslashes($return)));\n<\/pre>\n\n\n<p>should be changed to:<\/p>\n\n\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\n\/\/$redirect = array(&quot;error&quot; =&gt; $errors, &quot;added&quot; =&gt; md5(stripslashes($return)));\n<\/pre>\n\n\n<p>and below this add the new line of code:<\/p>\n\n\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\n$redirect = array(&quot;error&quot; =&gt; $errors, &quot;added&quot; =&gt; md5(stripslashes($return)), &quot;ipa&quot; =&gt; $id_product_attribute); \/\/ MP : Product Price By Size\n<\/pre>\n\n\n<h3 class=\"wp-block-heading\">awp_product.js<\/h3>\n\n\n\n<p>Around line number 2254, after the code below:<\/p>\n\n\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\nif (feed.error != &quot;&quot;)\n{\n    alert(feed.error);\n    return;\n}\n<\/pre>\n\n\n<p>Add the line of code below:<\/p>\n\n\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\nppbs.addDimensionsToCart(false, feed.ipa); \/\/ MP : Product Price By Size\n<\/pre>\n\n\n<p>All done, the above changes should allow the product price by size module to successfully add dimensions to the product being added to the cart, which may fail without the customizations above.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you&#8217;re using the Attribute Wizard Pro Module for Prestashop then you&#8217;ll soon find yourself running into problems with other modules which hook into Presashops cart functions. This is because Attribute Wizard Pro overrides and hijacks some of the core Prestashop cart functions. Although it is recommended to use the native Prestashop attributes \/ combinations [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":508,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-16","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorised"],"_links":{"self":[{"href":"https:\/\/www.prestafusion.com\/blog\/wp-json\/wp\/v2\/posts\/16","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.prestafusion.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.prestafusion.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.prestafusion.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.prestafusion.com\/blog\/wp-json\/wp\/v2\/comments?post=16"}],"version-history":[{"count":5,"href":"https:\/\/www.prestafusion.com\/blog\/wp-json\/wp\/v2\/posts\/16\/revisions"}],"predecessor-version":[{"id":509,"href":"https:\/\/www.prestafusion.com\/blog\/wp-json\/wp\/v2\/posts\/16\/revisions\/509"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.prestafusion.com\/blog\/wp-json\/wp\/v2\/media\/508"}],"wp:attachment":[{"href":"https:\/\/www.prestafusion.com\/blog\/wp-json\/wp\/v2\/media?parent=16"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.prestafusion.com\/blog\/wp-json\/wp\/v2\/categories?post=16"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.prestafusion.com\/blog\/wp-json\/wp\/v2\/tags?post=16"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}