Surprises of the transition from 3.1.1 to 3.5.8

Phoca Cart - complex e-commerce extension
srkuz
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 31 May 2018, 11:47

Surprises of the transition from 3.1.1 to 3.5.8

Post by srkuz »

Hi.
1.In administrator\components\com_phocacart\update\sql\mysql\3.5.4.sql is present next strings, which are also in 3.1.1.sql. I think it's hard to add a column if it already exists :)

ALTER TABLE `#__phocacart_product_stock` ADD COLUMN `sku` varchar(255) NOT NULL DEFAULT '';
ALTER TABLE `#__phocacart_product_stock` ADD COLUMN `ean` varchar(15) NOT NULL DEFAULT '';

2.In components\com_phocacart\views\items\tmpl\default.php is present next strings (from line 147):

$priceItems = $price->getPriceItems($v->price, $v->taxid, $v->taxrate, $v->taxcalculationtype, $v->taxtitle, $v->unit_amount, $v->unit_unit, 1, 1, $v->group_price);
$price->getPriceItemsChangedByAttributes($dP['priceitems'], $attributesOptions, $price, $v);
$dP['priceitemsorig']= array();
$dP['priceitems'] = $priceItems;

May be you should put "$dP['priceitems']=$priceItems;" before the call "$price->getPriceItemsChangedByAttributes"?

Otherwise, we pass an undefined $dP['priceitems'] to getPriceItemsChangedByAttributes() and had errors:
- Undefined index: netto in ...administrator\components\com_phocacart\libraries\phocacart\price\price.php on line 1051
- Undefined index: brutto in ...administrator\components\com_phocacart\libraries\phocacart\price\price.php on line 1052
- Undefined index: tax in ...administrator\components\com_phocacart\libraries\phocacart\price\price.php on line 1052

Or is there some other way to solve this problem?

Kind regards,
Sergey Kuznetsov
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Surprises of the transition from 3.1.1 to 3.5.8

Post by Jan »

Hi, the solution was made in Joomla 4 (Phoca Cart 4):

Code: Select all

// Standard Price - changed - we need to update it but only in case the price is not zero
        $priceP['nettoformat']  = isset($priceP['netto']) ? $price->getPriceFormat($priceP['netto']) : '';
        $priceP['bruttoformat'] = isset($priceP['brutto']) ? $price->getPriceFormat($priceP['brutto']) : '';
        $priceP['taxformat']    = isset($priceP['tax']) ? $price->getPriceFormat($priceP['tax']) : '';
in administrator\components\com_phocacart\libraries\phocacart\price\price.php on line 1051 - 1052

It is prepared for 3.5.9, so for now, if it is possible for you, just change it on your site (it will be not lost when updating as 3.5.9 will include it)

Jan
If you find Phoca extensions useful, please support the project
srkuz
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 31 May 2018, 11:47

Re: Surprises of the transition from 3.1.1 to 3.5.8

Post by srkuz »

Thanks
Post Reply