Jump to content

Cart Issues


bacowarrior

Recommended Posts

Hi all,

 

I've been experiencing several issues with my store and it was first picked up using the Attribute Wizard Pro module where the cart overrides were not appearing in the cart.

 

Then I have removed items from the cart which it does but the total doesn't. Refresh the page and the products re-appear.

 

I have checked the error log and the only error that keeps coming up is:

[13-Jan-2017 05:35:08 GMT] PHP Warning:  preg_match(): Compilation failed: unmatched parentheses at offset 13 in /home/xxxxxxxxx/public_html/giftprezzy.com/override/controllers/front/ProductController.php on line 24

 

This is the code:

<?php
/**
 * PrestaShop module created by VEKIA, a guy from official PrestaShop community ;-)
 *
 * @author    VEKIA https://www.prestashop.com/forums/user/132608-vekia/
 * @copyright 2010-2016 VEKIA
 * @license   This program is not free software and you can't resell and redistribute it
 *
 * CONTACT WITH DEVELOPER http://mypresta.eu
 * [email protected]
 */
class ProductController extends ProductControllerCore
{
	/*
    * module: purls
    * date: 2016-04-20 20:22:25
    * version: 1.8.3
    */
    public function init()
    {
        if (Configuration::get('purls_products')==1){
    		$link_pattern = Tools::safeOutput(urldecode(Tools::getValue('product_rewrite')));
    		$product_pattern = '/.*?\/[([0-9]+)]*\-([_a-zA-Z0-9-\pL]*)\.html/';
    		preg_match($product_pattern, $_SERVER['REQUEST_URI'], $Array);
    		if(isset($Array[2]) && $Array[2]!="" && $Array!=NULL)
    			$link_pattern = $urlArray[2];
                
    		if ($link_pattern)
            {	
    			$sql = "SELECT id_product FROM "._DB_PREFIX_."product_lang WHERE link_rewrite='".$link_pattern."' AND id_lang=".Context::getContext()->language->id." AND id_shop=".$this->context->shop->id;
    			$id_product = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);
    			if($id_product != "")
                {
    				$_POST['id_product'] = $id_product;
                    $_GET['id_product'] = $id_product;
    				$_GET['product_rewrite'] = '';
    			}
                else 
                {
                    header('HTTP/1.1 404 Not Found');
    				header('Status: 404 Not Found');    
                }
    		}
            else 
            {
                header('HTTP/1.1 404 Not Found');
                header('Status: 404 Not Found');    
            }        
    		parent::init();
        } else {
            parent::init();
        }
	}
}

I deleted the cache/class_index.php file as suggested by the creator of the Attribute Wizard Pro Module.

I re-installed the cart block module and made sure it was hooked in the Header.

Tried clearing cache.

Disabled overrides and re-enabled them.

 

The screenshot also shows the issues appearing on the debugger.

 

 

post-736573-0-34961900-1484289020_thumb.png

 

Hope someone can help.

 

Many thanks.

Edited by bacowarrior (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...