92 lines
3.1 KiB
PHP
92 lines
3.1 KiB
PHP
<?php
|
|
/**
|
|
* SOTESHOP/stGroupPriceBackend
|
|
*
|
|
*
|
|
* @package stGroupPricePlugin
|
|
* @author Bartosz Alejski <bartosz.alejski@sote.pl>
|
|
*/
|
|
|
|
class stGroupPriceBackendComponents extends autoStGroupPriceBackendComponents {
|
|
|
|
public function executeConfigContent() {
|
|
|
|
}
|
|
|
|
public function executeProductPriceUpdate()
|
|
{
|
|
if (null == $this->group->getPriceType())
|
|
{
|
|
$group_price['id'] = $this->group->getId();
|
|
$group_price['set_one_price'] = "false";
|
|
$group_price['currency_id'] = $this->group->getCurrencyId();
|
|
$group_price['tax_id'] = $this->group->getTaxId();
|
|
$group_price['opt_vat'] = $this->group->getOptVat();
|
|
$group_price['price_netto'] = $this->group->getPriceNetto();
|
|
$group_price['price_brutto'] = $this->group->getPriceBrutto();
|
|
$group_price['old_price_netto'] = $this->group->getOldPriceNetto();
|
|
$group_price['old_price_brutto'] = $this->group->getOldPriceBrutto();
|
|
$group_price['wholesale_a_price_netto'] = $this->group->getWholesaleANetto();
|
|
$group_price['wholesale_a_price_brutto'] = $this->group->getWholesaleABrutto();
|
|
$group_price['wholesale_b_price_netto'] = $this->group->getWholesaleBNetto();
|
|
$group_price['wholesale_b_price_brutto'] = $this->group->getWholesaleBBrutto();
|
|
$group_price['wholesale_c_price_netto'] = $this->group->getWholesaleCNetto();
|
|
$group_price['wholesale_c_price_brutto'] = $this->group->getWholesaleCBrutto();
|
|
|
|
stChangePriceProgressBar::setParam('group_price', $group_price);
|
|
}
|
|
else
|
|
{
|
|
$price = $this->group->getPriceModifier();
|
|
|
|
$price = trim($price);
|
|
|
|
if ($price[0] == "+")
|
|
{
|
|
$prefix = "+";
|
|
$value = substr($price, 1);
|
|
}
|
|
elseif ($price[0] == "-")
|
|
{
|
|
$prefix = "-";
|
|
$value = substr($price, 1);
|
|
}
|
|
else
|
|
{
|
|
$prefix = "false";
|
|
$value = $price;
|
|
}
|
|
|
|
$reverse_price = strrev($price);
|
|
|
|
if ($reverse_price[0] == "%")
|
|
{
|
|
|
|
$value = substr($price, 1, -1);
|
|
|
|
$sufix = "true";
|
|
}
|
|
else
|
|
{
|
|
$sufix = "false";
|
|
}
|
|
|
|
$group_price['id'] = $this->group->getId();
|
|
$group_price['currency_id'] = $this->group->getCurrencyId();
|
|
$group_price['tax_id'] = $this->group->getTaxId();
|
|
$group_price['opt_vat'] = $this->group->getOptVat();
|
|
$group_price['set_one_price'] = "true";
|
|
$group_price['type'] = $this->group->getPriceType();
|
|
$group_price['value'] = $value;
|
|
$group_price['prefix'] = $prefix;
|
|
$group_price['sufix'] = $sufix;
|
|
|
|
stChangePriceProgressBar::setParam('group_price', $group_price);
|
|
}
|
|
|
|
// throw new Exception('<pre>'.var_export($group_price, true).'</pre>');
|
|
|
|
$this->count = $this->group->countProducts();
|
|
}
|
|
|
|
} |