Post by MidnightCoder » Mon Mar 31, 2014 3:02 pm

Hi, I'm new to opencart, openshop, vQmod, and so on, so please bear with me if this has been asked. I haven't found other instances of this bug yet via forum or google search.

I updated vQmod to latest last night, and now I get this error when trying to view the site:
Parse error: syntax error, unexpected '=', expecting ')' in /home/indienet/public_html/vqmod/vqcache/vq2-system_library_cart.php on line 318
Line 318 of /vqmod/vqcache/vq2-system_library_cart.php is this:

Code: Select all

public function add($product_id, $qty = 1, $option, $profile_id = '' = '') {
Note the extra = ''

So, I went hunting and found the function in /system/library/cart.php and it appears to be correct:

Code: Select all

public function add($product_id, $qty = 1, $option, $profile_id = '') {
This leads me to believe it's happening during caching, but I'm not sure where to look for this.

I did a byte for byte comparison of the two files, and this is the only difference between them. If I correct the cache file, it works properly until something causes the cache to be refreshed, and then the site crashes with the same error.

Any help or pointers would be much appreciated.

Newbie

Posts

Joined
Mon Mar 31, 2014 2:44 pm

Post by madimar » Tue Apr 01, 2014 4:05 pm

Have you tried to clean all caches? Furthermore, have you checked your xml scripts in vqmod/xml folder? Any duplicated script?

Regards,

M

-----------------------------------------------------------------------
My last mods: Partita IVA e CF | Pro EU VAT Number | Sales Agents | Pricelist Pro
-----------------------------------------------------------------------


User avatar
Active Member

Posts

Joined
Thu Sep 24, 2009 6:27 pm


Post by MidnightCoder » Tue Apr 01, 2014 5:41 pm

Thanks! That was the pointer I needed.

The code responsible for the error was in OpenCart-1.5.6-Fixes.xml

Code: Select all

<!-- Missing argument 4 for Cart::Add Fix-->

	<file name="system/library/cart.php">
		<operation error="skip">
			<search position="replace"><![CDATA[$qty = 1, $option, $profile_id]]></search>
			<add><![CDATA[$qty = 1, $option, $profile_id = '']]></add>
		</operation>
	</file>
Since the needed fix is already applied to the file, it should be omitted in the xml.

Newbie

Posts

Joined
Mon Mar 31, 2014 2:44 pm
Who is online

Users browsing this forum: No registered users and 7 guests