Jump to content

Antarr

Members
  • Posts

    70
  • Joined

  • Last visited

Profile Information

  • Location
    EEE
  • First Name
    Antar
  • Last Name
    Rr

Recent Profile Visitors

236 profile views

Antarr's Achievements

Newbie

Newbie (1/14)

2

Reputation

2

Community Answers

  1. Ещё бы понять как это впихнуть в остальные показы товаров: в блоке в колонке слева или справа, в списках и сетках, в модулях карусели на главной странице. Чёт повставлял, но приуныл... Не показывает.
  2. В общем, кажется вот это похоже на правду: {assign var='partner_price' value=SpecificPrice::getSpecificPrice($product->id, 1, 1, 177, 4, 1, 0, 0, 0, 0)} <p id="partner_price">{strip}<span class="partner_price">Partner price: {convertPrice price=$partner_price.price|floatval}</span>{/strip}</p> Топорновато выглядит же. Кто подскажет, как причесать или фиг с ним?
  3. По ходу, нам этот метод не нужен. В нём будет цена, только если она есть для группы (точнее, для $id_customer)?
  4. Вот ещё выкопал класс classes/SpecificPrice.php https://github.com/PrestaShop/PrestaShop/blob/develop/classes/SpecificPrice.php С 331 строки функция. public static function getSpecificPrice($id_product, $id_shop, $id_currency, $id_country, $id_group, $quantity, $id_product_attribute = null, $id_customer = 0, $id_cart = 0, $real_quantity = 0) { if (!SpecificPrice::isFeatureActive()) { return array(); } /* ** The date is not taken into account for the cache, but this is for the better because it keeps the consistency for the whole script. ** The price must not change between the top and the bottom of the page */ $key = ((int)$id_product.'-'.(int)$id_shop.'-'.(int)$id_currency.'-'.(int)$id_country.'-'.(int)$id_group.'-'.(int)$quantity.'-'.(int)$id_product_attribute.'-'.(int)$id_cart.'-'.(int)$id_customer.'-'.(int)$real_quantity); if (!array_key_exists($key, SpecificPrice::$_specificPriceCache)) { $query_extra = self::computeExtraConditions($id_product, $id_product_attribute, $id_customer, $id_cart); $query = ' SELECT *, '.SpecificPrice::_getScoreQuery($id_product, $id_shop, $id_currency, $id_country, $id_group, $id_customer).' FROM `'._DB_PREFIX_.'specific_price` WHERE `id_shop` '.self::formatIntInQuery(0, $id_shop).' AND `id_currency` '.self::formatIntInQuery(0, $id_currency).' AND `id_country` '.self::formatIntInQuery(0, $id_country).' AND `id_group` '.self::formatIntInQuery(0, $id_group).' '.$query_extra.' AND IF(`from_quantity` > 1, `from_quantity`, 0) <= '; $query .= (Configuration::get('PS_QTY_DISCOUNT_ON_COMBINATION') || !$id_cart || !$real_quantity) ? (int)$quantity : max(1, (int)$real_quantity); $query .= ' ORDER BY `id_product_attribute` DESC, `from_quantity` DESC, `id_specific_price_rule` ASC, `score` DESC, `to` DESC, `from` DESC'; SpecificPrice::$_specificPriceCache[$key] = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($query); } return SpecificPrice::$_specificPriceCache[$key]; } Смущает то, что надо передавать id_group. По ходу, сюда надо просто вбить 4 как id группы партнёров? Как в итоге должна бы выглядеть строчка?
  5. Где их можно откопать, чтобы посмотреть? // It needs an instanceProduct::getPrice($tax = true, $id_product_attribute = null, $decimals = 6, $divisor = null, $only_reduc = false, $usereduc = true, $quantity = 1)// Static wayProduct::getPriceStatic($id_product, $usetax = true, $id_product_attribute = null, $decimals = 6, $divisor = null, $only_reduc = false, $usereduc = true, $quantity = 1, $force_associated_tax = false, $id_customer = null, $id_cart = null, $id_address = null, &$specific_price_output = null, $with_ecotax = true, $use_group_reduction = true, Context $context = null, $use_customer_price = true); http://nemops.com/prestashop-functions-3/ Это? Вот ещё есть какая-то фнукция public static function getSpecificPrice($id_product, $id_shop, $id_currency, $id_country, $id_group, $quantity, $id_product_attribute = null, $id_customer = 0, $id_cart = 0, $real_quantity = 0) Но нет единой документации, ПШ - это какое-то поделие-копромонолит, который копать можно месяц подряд. =((
  6. Так выводит цену, но ту же самую, которая для текущей группы. То бишь, дублирует. Приаттачу product.tpl на всякий случай, 185-187 строка. http://dropmefiles.com/JfaNv
  7. Fatal error: Cannot use object of type Product as array in /var/www/data/ftp/www/site/tools/smarty/sysplugins/smarty_internal_templatebase.php(171) : eval()'d code on line 338
  8. Это понятно. Но можно достать из базы спеццену и просто её вывести, вне зависимости от того, кто страницу загружает. Вот я чего хочу.
  9. Группа есть, называется "Partners". C её заведения и проставления специальных цен для этой группы и возник этот вопрос: как вывести и показать цену для конкретной группы для всех. Второй строчкой под основной ценой. Однако, покупать посетитель должен по цене своей группы. Эта информаия (о цене для партнёров) для него справочная.
  10. У каждого товара разная скидка, причём, не процентная. Настраивается в разделе Specific price для конкретной группы. В 185 строке product.tpl (и в некоторых других файлах, но это пока не суть) можно было бы вставить что-то типа: <p id="specific-partner-price">{strip}<span class="price">Partner price: {convertPrice price=$product->specificPrice.price|floatval}</span>{/strip}</p> Но оно корректно показывается, когда пользователь уже в группе. А просто мимопрохожему показывается пустота или Undefined index.
  11. Выводить вторую цену нужно для всех, включая поисковых роботов.
  12. Well. If I would show just a text string in the product views with some information, I just could only add it to the short description! Guess, masters of Prestashop should be ashamed. He-he. Ololo. Simple quick and elegant solution. Ehe.
  13. It seems you don't understand what I want. I want just show additional text (called "specific price") in the every product view for informational purposes. Just show. Below the current price. No matter what is the current price now. Just show one specific price for everyone no matter logged or not. Specific price could be added by standard method by editing product prices. There's a settings item for it in the administration panel.
×
×
  • Create New...