Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Login 注册用户可以';不要添加到购物车。普雷斯塔什酒店_Login_Prestashop_Add_Cart_Avalara - Fatal编程技术网

Login 注册用户可以';不要添加到购物车。普雷斯塔什酒店

Login 注册用户可以';不要添加到购物车。普雷斯塔什酒店,login,prestashop,add,cart,avalara,Login,Prestashop,Add,Cart,Avalara,我有个大问题 这个问题已经讨论了好几次了,但我无法使它起作用 我尝试了Prestashop论坛上的所有建议(也发布了,但仍然没有回复): 1.正在更改商店域和SSL。 首先,我把它作为growmundocannabico.com(在这两个地方都不起作用),改为www.growmundocannabico.com,但仍然没有解决这个问题 清除coockies和所有浏览器历史记录(firefox)并没有解决问题。P.D.在其他浏览器上也不起作用。在铬和IE10上测试 尝试修改.htcacess文件,

我有个大问题

这个问题已经讨论了好几次了,但我无法使它起作用

我尝试了Prestashop论坛上的所有建议(也发布了,但仍然没有回复): 1.正在更改商店域和SSL。 首先,我把它作为growmundocannabico.com(在这两个地方都不起作用),改为www.growmundocannabico.com,但仍然没有解决这个问题

  • 清除coockies和所有浏览器历史记录(firefox)并没有解决问题。P.D.在其他浏览器上也不起作用。在铬和IE10上测试

  • 尝试修改.htcacess文件,没有帮助

  • 这是商店的网址:www.growmundocannabico.com

    我已更改定义(“PS模式开发”,错误);定义(“PS模式开发”,真);在config/define.inc.php中显示错误。结果就在附件里

    有人能简单地解释一下为什么这意味着什么,我应该怎么做来修复它???因为编程不是我的强项

    谢谢

    这是密码:我不明白 1.第20行是一个* 2.没有php不是封闭的,应该是这样吗

    <?php
    /*
    * 2007-2012 PrestaShop
    *
    * NOTICE OF LICENSE
    *
    * This source file is subject to the Open Software License (OSL 3.0)
    * that is bundled with this package in the file LICENSE.txt.
    * It is also available through the world-wide-web at this URL:
    * http://opensource.org/licenses/osl-3.0.php
    * If you did not receive a copy of the license and are unable to
    * obtain it through the world-wide-web, please send an email
    * to license@prestashop.com so we can send you a copy immediately.
    *
    * DISCLAIMER
    *
    * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
    * versions in the future. If you wish to customize PrestaShop for your
    * needs please refer to http://www.prestashop.com for more information.
    *
    *  @author PrestaShop SA <contact@prestashop.com>
    *  @copyright  2007-2012 PrestaShop SA
    *  @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
    *  International Registered Trademark & Property of PrestaShop SA
    */
    
    
    class TaxCore extends ObjectModel
    {
        /** @var string Name */
        public $name;
    
        /** @var float Rate (%) */
        public $rate;
    
        /** @var bool active state */
        public $active;
    
        /** @var boolean true if the tax has been historized */
        public $deleted = 0;
    
        /**
         * @see ObjectModel::$definition
         */
        public static $definition = array(
            'table' => 'tax',
            'primary' => 'id_tax',
            'multilang' => true,
            'fields' => array(
                'rate' =>           array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat', 'required' => true),
                'active' =>         array('type' => self::TYPE_BOOL),
                'deleted' =>        array('type' => self::TYPE_BOOL),
    
                // Lang fields
                'name' =>           array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 32),
            ),
        );
    
    
        protected static $_product_country_tax = array();
        protected static $_product_tax_via_rules = array();
    
        protected   $webserviceParameters = array(
            'objectsNodeName' => 'taxes',
        );
    
        public function delete()
        {
            /* Clean associations */
            TaxRule::deleteTaxRuleByIdTax((int)$this->id);
    
            if ($this->isUsed())
                return $this->historize();
            else
                return parent::delete();
        }
    
        /**
         * Save the object with the field deleted to true
         *
         *  @return bool
         */
        public function historize()
        {
            $this->deleted = true;
            return parent::update();
        }
    
        public function toggleStatus()
        {
            if (parent::toggleStatus())
                return $this->_onStatusChange();
    
            return false;
        }
    
        public function update($nullValues = false)
        {
            if (!$this->deleted && $this->isUsed())
            {
                $historized_tax = new Tax($this->id);
                $historized_tax->historize();
    
                // remove the id in order to create a new object
                $this->id = 0;
                $this->add();
    
                // change tax id in the tax rule table
                TaxRule::swapTaxId($historized_tax->id, $this->id);
            } else if (parent::update($nullValues))
                    return $this->_onStatusChange();
    
            return false;
        }
    
        protected function _onStatusChange()
        {
            if (!$this->active)
                return TaxRule::deleteTaxRuleByIdTax($this->id);
    
            return true;
        }
    
        /**
         * Returns true if the tax is used in an order details
         *
         * @return bool
         */
        public function isUsed()
        {
            return Db::getInstance()->getValue('
            SELECT `id_tax`
            FROM `'._DB_PREFIX_.'order_detail_tax`
            WHERE `id_tax` = '.(int)$this->id
            );
        }
    
        /**
        * Get all available taxes
        *
        * @return array Taxes
        */
        public static function getTaxes($id_lang = false, $active_only = true)
        {
            $sql = new DbQuery();
            $sql->select('t.id_tax, t.rate');
            $sql->from('tax', 't');
            $sql->where('t.`deleted` != 1');
    
            if ($id_lang)
            {
                $sql->select('tl.name, tl.id_lang');
                $sql->leftJoin('tax_lang', 'tl', 't.`id_tax` = tl.`id_tax` AND tl.`id_lang` = '.(int)$id_lang);
                $sql->orderBy('`name` ASC');
            }
    
            if ($active_only)
                $sql->where('t.`active` = 1');
    
            return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
        }
    
        public static function excludeTaxeOption()
        {
            static $ps_tax = null;
            if ($ps_tax === null)
                $ps_tax = Configuration::get('PS_TAX');
    
            return !$ps_tax;
        }
    
        /**
        * Return the tax id associated to the specified name
        *
        * @param string $tax_name
        * @param boolean $active (true by default)
        */
        public static function getTaxIdByName($tax_name, $active = 1)
        {
            $tax = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
                SELECT t.`id_tax`
                FROM `'._DB_PREFIX_.'tax` t
                LEFT JOIN `'._DB_PREFIX_.'tax_lang` tl ON (tl.id_tax = t.id_tax)
                WHERE tl.`name` = \''.pSQL($tax_name).'\' '.
                ($active == 1 ? ' AND t.`active` = 1' : ''));
    
            return $tax ? (int)($tax['id_tax']) : false;
        }
    
        /**
        * Returns the ecotax tax rate
        *
        * @param id_address
        * @return float $tax_rate
        */
        public static function getProductEcotaxRate($id_address = null)
        {
            $address = Address::initialize($id_address);
    
            $tax_manager = TaxManagerFactory::getManager($address, (int)Configuration::get('PS_ECOTAX_TAX_RULES_GROUP_ID'));
            $tax_calculator = $tax_manager->getTaxCalculator();
    
            return $tax_calculator->getTotalRate();
        }
    
        /**
        * Returns the carrier tax rate
        *
        * @param id_address
        * @return float $tax_rate
        */
        public static function getCarrierTaxRate($id_carrier, $id_address = null)
        {
            $address = Address::initialize($id_address);
            $id_tax_rules = (int)Carrier::getIdTaxRulesGroupByIdCarrier((int)$id_carrier);
    
            $tax_manager = TaxManagerFactory::getManager($address, $id_tax_rules);
            $tax_calculator = $tax_manager->getTaxCalculator();
    
            return $tax_calculator->getTotalRate();
        }
    
        /**
         * Return the product tax rate using the tax rules system
         *
         * @param integer $id_product
         * @param integer $id_country
         * @return Tax
         *
         * @deprecated since 1.5
         */
        public static function getProductTaxRateViaRules($id_product, $id_country, $id_state, $zipcode)
        {
            Tools::displayAsDeprecated();
    
            if (!isset(self::$_product_tax_via_rules[$id_product.'-'.$id_country.'-'.$id_state.'-'.$zipcode]))
            {
                $tax_rate = TaxRulesGroup::getTaxesRate((int)Product::getIdTaxRulesGroupByIdProduct((int)$id_product), (int)$id_country, (int)$id_state, $zipcode);
                self::$_product_tax_via_rules[$id_product.'-'.$id_country.'-'.$zipcode] = $tax_rate;
            }
    
            return self::$_product_tax_via_rules[$id_product.'-'.$id_country.'-'.$zipcode];
        }
    
        /**
         * Returns the product tax
         *
         * @param integer $id_product
         * @param integer $id_country
         * @return Tax
         */
        public static function getProductTaxRate($id_product, $id_address = null, Context $context = null)
        {
            if ($context == null)
                $context = Context::getContext();
    
            $address = Address::initialize($id_address);
            $id_tax_rules = (int)Product::getIdTaxRulesGroupByIdProduct($id_product, $context);
    
            $tax_manager = TaxManagerFactory::getManager($address, $id_tax_rules);
            $tax_calculator = $tax_manager->getTaxCalculator();
    
            return $tax_calculator->getTotalRate();
        }
    }
    

    错误似乎出现在覆盖“Tax”类中。它是做什么的,为什么会在那里?它不是标准的Prestashop的一部分,因此错误很可能就在那里。正如错误消息所说,该代码中的某些内容使用无效参数调用getProductTaxRate()。

    我已删除了创建的税。只留下原来的那些。。。但问题仍然是…:(很明显,税收有点奇怪。我还注意到,当我登录时,税收消失了..发生了什么事???税收设置了,规则也为西班牙设置了…你删除了覆盖类了吗?我在哪里可以找到它?我现在迷路了…我正在寻找解决方案好几个小时了…它在你的Prest中的覆盖/类中ashop安装,如错误消息所示。这不是覆盖类,是吗?看起来像是标准包含的TaxCore类。
    <?php
    
    class Tax extends TaxCore
    {
    
        /**
         * Return the product tax
         *
         * @param integer $id_product
         * @param integer $id_address
         * @return Tax Rate
         */
        public static function getProductTaxRate($id_product, $id_address = null, $getCarrierRate = false)
        {
            include_once(_PS_ROOT_DIR_.'/modules/avalaratax/avalaratax.php');
    
            /* Instanciate the Avalara module and check if active */
            $avalara = new AvalaraTax();
            if (!$avalara->active)
                return parent::getProductTaxRate($id_product, $id_address, $getCarrierRate);
    
            /* With Avalara, we disable the tax for non logged users */
            if (!(int)$id_address)
                return 0.;
    
            $region = Db::getInstance()->getValue('SELECT s.`iso_code`
                                        FROM '._DB_PREFIX_.'address a
                                        LEFT JOIN '._DB_PREFIX_.'state s ON (s.`id_state` = a.`id_state`)
                                        WHERE a.`id_address` = '.(int)$id_address);
    
            /* If the Merchant does not want to calculate taxes outside his state and we are outside the state, we return 0 */
            if ((!empty($region) && $region != Configuration::get('AVALARATAX_STATE') && !Configuration::get('AVALARATAX_TAX_OUTSIDE')))
                return 0.;
    
            return (float)Db::getInstance()->getValue('SELECT ac.`tax_rate`
            FROM '._DB_PREFIX_.'avalara_'.($getCarrierRate ? 'carrier' : 'product').'_cache ac
            WHERE ac.`id_'.($getCarrierRate ? 'carrier' : 'product').'` = '.(int)$id_product.'
            AND ac.`region` = \''.pSQL($region).'\'');
        }
    
        public static function getCarrierTaxRate($id_carrier, $id_address = NULL)
        {
            return (float)self::getProductTaxRate($id_carrier, $id_address, true);
        }
    }