Skip to content

Instantly share code, notes, and snippets.

View a-kosygin-parc's full-sized avatar

Alexandr Kosygin a-kosygin-parc

View GitHub Profile
@a-kosygin-parc
a-kosygin-parc / img
Created March 11, 2013 08:42
Вывод изображения карточки в CS-Cart
<img class="b-card-image" src="{if empty($product.main_pair.detailed.image_path)}/images/no_image.gif{else}{$product.main_pair.detailed.image_path}{/if}" alt="" />
@a-kosygin-parc
a-kosygin-parc / gist:5135999
Created March 11, 2013 17:32
Подключение меток New Sale на товар
{* Базовая цена товара *}
{if (($product.discount_prc > $addons.iecsp_product_lables.discount) || ($product.list_discount_prc > $addons.iecsp_product_lables.discount)) }
<strike>{$product.base_price}</strike>
{/if}
{* Подключаем лейблы New, Sale и т.д *}
{include file="addons/iecsp_product_lables/hooks/products/prices_block.post.tpl"}
@a-kosygin-parc
a-kosygin-parc / gist:5144272
Created March 12, 2013 16:17
Правильная ссылка на товар
{* 1) Ссылка на страничку с карточкой товара *}
<a href="{"products.view?product_id=`$product.product_id`"|fn_url}">Ссылка на карточку товара</a>
{* 2) Тоже самое что и первая ссылка, но оформлено в виде подключаемого извне шаблона. Там много интересного *}
{include file="buttons/button.tpl" but_href="products.view?product_id=`$product.product_id`" but_text=$lang.view_details but_role="submit"}
{**
* 3) Ссылка на быстрый просмотр карточки товара
* Если вызывается AJAX, то возвращает шаблон views/products/quick_view.tpl
* иначе редиректит на ссылку вида 1)
@a-kosygin-parc
a-kosygin-parc / gist:5433327
Created April 22, 2013 08:42
combinations_list
{assign var="product_combinations" value=$product.product_id|pudra_get_combinations}
{if !empty($product_combinations.combinations)}
<div class="b-product-sizes">
{foreach from=$product_combinations.combinations item="combination"}
{assign var="variant_id" value=$combination.combination|current}
{assign var="variant" value=$product_combinations.options[$variant_id]}
{assign var="num_variant" value=$variant.variant_name|@intval}
{if $num_variant lte 25}
{assign var="num_variant_size" value=1}
@a-kosygin-parc
a-kosygin-parc / exec_request
Created July 11, 2013 14:25
CS-Cart addon delivery
/////////////////////////////////////
//Delivery service specific functions
////////////////////////////////////
private function exec_request($path, $request_method, $request = 0) {
$delivery_service = db_get_row("SELECT * FROM ?:delivery_services_settings WHERE services_class_name = ?s", get_called_class());
$host = $delivery_service['gateway']; // Адрес удаленного хоста
$login = $delivery_service['username']; // Логин пользователя
$pass = $delivery_service['password']; // Пароль пользователя
@a-kosygin-parc
a-kosygin-parc / пример XML orders 1c
Created July 12, 2013 08:12
пример XML orders 1c
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<КоммерческаяИнформация ВерсияСхемы="2.05" ДатаФормирования="2013-07-12">
<Классификатор>
<Группы>
<Группа>
<Ид>63864D09-694C-43AF-92B5-4EF795873B39</Ид>
<Наименование>Парфюмерия</Наименование>
<Группы>
<Группа>
<Ид>0672F2AB-A962-45F8-A07D-509A8D93B8C3</Ид>