Shopping Cart Plugin

სწრაფი ნავიგაცია 1 Route map 2 main.tpl ინტეგრაცია 3 AJAX + DLEPush 4 Stock + Coupons 5 Product tags 6 Header tags 7 Cart tags 8 Checkout tags 9 Order / Invoice tags 10 Component tags 11 Payment templates 1 Rou...

6 წთ
ყველა სტატია

Shopping Cart Plugin

ბოლო განახლება April 25, 2026

1 Route map და არქიტექტურა

პლაგინი მუშაობს DLE index.php?do=... route-ებით. ქვემოთ არის ძირითადი გვერდები და მათი მოდულები.

Route მოდული როლი
index.php?do=cart engine/modules/ticcix/cart.php კალათა, რაოდენობის განახლება, coupon apply/remove, AJAX payload
index.php?do=checkout engine/modules/ticcix/checkout.php checkout ფორმა, billing, order create
index.php?do=order&id=... engine/modules/ticcix/order.php ორდერის დეტალები, payment actions, shipping/digital ბლოკები
index.php?do=invoice&id=... engine/modules/ticcix/invoice.php ინვოისი
index.php?do=userorders engine/modules/ticcix/userorders.php მომხმარებლის შეკვეთების სია
index.php?do=paypal_pay&id=... engine/modules/paypal_pay.php PayPal session/redirect
index.php?do=bog_pay&id=... engine/modules/bog_pay.php BOG session/redirect

შენიშვნა: checkout/order/invoice/userorders route-ები plugin hook-იდან იტვირთება, ამიტომ ქეში/plugin ფაილებში include ჩანაწერების არსებობა ნორმალურია.

2 main.tpl ინტეგრაცია (სავალდებულო)

რომ header კალათა ცოცხლად განახლდეს, აქტიური თემის main.tpl-ში ჩასვი {cart_header}. (მაგ: templates/Default/main.tpl ან შენი სხვა theme)

<!-- Header / Navigation -->
<div class="site-nav">
    <a href="/">Home</a>
    <a href="/index.php?do=cart">Cart</a>
    {cart_header}
</div>

Product view-ში: shortstory.tpl და fullstory.tpl უნდა იყენებდეს {product-button} და საჭირო [product]...[/product] ბლოკებს.

3 AJAX + DLEPush (გვერდის reload-ის გარეშე)

პლაგინი frontend assets-ით აბამს submit event-ს და fetch-ით აგზავნის მოთხოვნას ajax=1 პარამეტრით. წარმატებაზე აჩვენებს DLEPush.info, შეცდომაზე DLEPush.error.

სავალდებულო CSS class-ები

  • {product-button} შიგნით ფორმები: tx-add-to-cart-form, tx-cart-control-form
  • კალათის ფორმები (cart.tpl, cart_items.tpl) ასევე tx-cart-control-form

DOM hooks

  • Header root: data-cart-header-root
  • Counter: data-cart-count
  • Total: data-cart-total
  • Cart page wrapper: data-tx-cart-page
  • Product actions wrapper: data-tx-product-actions="{item_id}"
AJAX response key დანიშნულება
success, message DLEPush/toast შეტყობინება
count, count_text, total_text header counter/total update
header_html header cart სრული block-ის ჩანაცვლება
cart_page_html კალათის გვერდის სრული HTML-ის ჩანაცვლება
item_id, item_qty, product_actions_html კონკრეტული პროდუქტის action ბლოკის განახლება

4 Stock limit + Coupon წესები

Stock კონტროლი

  • ფიზიკური პროდუქტი: რაოდენობა იზღუდება stock-ით.
  • ციფრული/ვირტუალური: stock არ იზღუდება.
  • თუ მარაგი 3-ია, კალათაში 3-ზე მეტს ვერ დაამატებ.
  • შეტყობინება მოდის key-ებით: stock_limit_reached, out_of_stock.

Coupon სისტემა

  • Admin: /admin.php?mod=orders&tab=coupons
  • ტიპები: percent, fixed cart, fixed product.
  • ვადები: მინ. თანხა, მაქს. დისკაუნტი, product targeting, free shipping.
  • იგივე კოდის შენახვა — არსებული კუპონის განახლებაა.

{label_applied_coupon} რომ ყოველთვის ჩანდეს სწორად: გამოიყენე მხოლოდ [discountuse]...[/discountuse] ბლოკში (cart/checkout/order/invoice).

[discountuse]
<div class="coupon-pill">{label_applied_coupon} ({discount})</div>
[/discountuse]

5 Product tags (shortstory/fullstory)

ეს ტეგები მუშავდება ticcix_cart_apply_product_tags()-ში და შეგიძლია გამოიყენო shortstory.tpl / fullstory.tpl-ში.

Tag რა აბრუნებს სად ვიყენებთ
{product-price} მიმდინარე ფასი პრაის ბლოკი
{product-old-price} ძველი ფასი sale ვიზუალი
{product-currency} ვალუტის სიმბოლო ფასთან ერთად
{product-sku} SKU meta/specs
{product-stock} მარაგი stock label
{product-brand} ბრენდი specs/meta
{product-color} ფერი ატრიბუტები
{product-size} ზომა ატრიბუტები
{product-weight} წონა ატრიბუტები
{product-material} მასალა ატრიბუტები
{product-condition} მდგომარეობა badge/specs
{product-availability} ხელმისაწვდომობა badge
{product-type} physical / digital / virtual / service ტიპის ნიშანი
{product-is-digital} 1 ან 0 custom JS/logic
{product-is-virtual} 1 ან 0 custom JS/logic
{product-attributes} ატრიბუტების მზა HTML spec chips
{product-button} add/remove/qty სრული UI ქარდში ან დეტალში
{product-cart-qty} ამ პროდუქტის რაოდენობა კალათაში custom badge
{product-json} JSON representation advanced integrations
{product-image} მთავარი სურათი gallery cover
{product-gallery} მზა gallery HTML დეტალის გვერდი
{product-gallery-count} დამატებითი gallery სურათების რაოდენობა UI logic
{product-gallery-raw} raw field value debug/custom parse
{product-gallery-1}{product-gallery-12} ინდივიდუალური gallery URL-ები custom thumbs/gallery
{product-download-url} download URL digital access
{product-download-label} download ღილაკის ტექსტი digital access

Product ბლოკები

Block მნიშვნელობა
[product]...[/product] ჩანს როცა post პროდუქტიაო (enabled)
[not-product]...[/not-product] ჩანს როცა პროდუქტი არაა
[has-product-gallery]...[/has-product-gallery] თუ gallery-ში დამატებითი სურათებია
[not-product-gallery]...[/not-product-gallery] თუ gallery ცარიელია
[has-product-gallery-1]...[/has-product-gallery-1][has-product-gallery-12]...[/has-product-gallery-12] ინდექსური სურათის არსებობაზე

6 Header tags

{cart_header} ტეგი რენდერს templates/Default/cart/header_cart.tpl-დან.

Tag / Block სად მნიშვნელობა
{cart_url}, {checkout_url} header_cart.tpl ლინკები
{cart_count}, {cart_count_label} header_cart.tpl count
{cart_total}, {currency} header_cart.tpl ჯამი
{cart_items_preview}, {cart_items_preview_count} header_cart.tpl preview სია
{label_cart}, {label_added_products}, {label_total}, {label_view_cart}, {label_checkout}, {label_cart_empty} header_cart.tpl ენობრივი ლეიბლები
[has-cart-items], [no-cart-items] header_cart.tpl preview/empty ლოგიკა
{title}, {img}, {link}, {qty}, {price}, {line_total}, {label_qty}, {currency} header_cart_item.tpl preview item row

7 Cart page tags (cart/cart.tpl)

Tag მნიშვნელობა
{cart_heading}, {notice} header ტექსტი
{cart_items} item list HTML
{cart_count}, {cart_count_label} ერთეულების რაოდენობა
{subtotal}, {tax}, {shipping}, {discount_amount}, {total}, {currency} ფინანსური ბლოკი
{discount} დისქაუნთის ტექსტური ფორმატი (მაგ. 10%, 3.00 $ / item)
{cart_url}, {checkout_url}, {continue_url} action/link
{coupon_placeholder}, {label_apply_coupon}, {label_remove_coupon}, {label_applied_coupon}, {coupon_code} coupon UI
{shop_name} shop title (optional template use)
[cart] cart page wrapper block
[discount] coupon UI ჩნდება როცა coupons enabled
[discountuse] ჩანს მხოლოდ გამოყენებული coupon-ისას

8 Checkout tags (cart/checkout.tpl)

Tag / Block მნიშვნელობა
{checkout_message}, {label_checkout_title} checkout intro
{cart_items}, {label_your_products} პროდუქტების სია
{payment_options}, {label_payment_method} გადახდის მეთოდები
{subtotal}, {tax}, {shipping}, {discount_amount}, {total}, {currency} summary თანხები
{label_applied_coupon}, {coupon_code} გამოყენებული კუპონის ტექსტი/კოდი
{billing_name}, {billing_fname}, {billing_lname}, {billing_email}, {billing_phone}, {billing_address}, {billing_address1}, {billing_address2}, {billing_country}, {billing_state}, {billing_zip} billing პროფილი
{placeholder_first_name}, {placeholder_last_name}, {placeholder_email}, {placeholder_phone}, {placeholder_address}, {placeholder_address2}, {placeholder_country}, {placeholder_state}, {placeholder_zip}, {placeholder_customer_note} ფორმის placeholder ტექსტები
{attribute_tags}, {label_product_attribute_support}, {label_attribute_support_message} ატრიბუტების საინფორმაციო ბლოკი
{shop_name}, {shop_email}, {shop_phone}, {label_store_contacts} მაღაზიის კონტაქტები
[billing], [notes], [discountuse] პირობითი ბლოკები

9 Order / Invoice / User Orders tags

Order page — cart/order.tpl

Tag / Block მნიშვნელობა
{order_id}, {date} ორდერის იდენტიფიკაცია
{name}, {email}, {phone}, {address} მომხმარებლის ინფორმაცია
{payment_method}, {status} სტატუსები
{product} ordered products HTML
{subtotal}, {tax}, {shipping}, {discount_amount}, {price}, {currency} თანხები
{payment_methods} payment template block
{shipping_info}, {digital_downloads} ლოგისტიკა/დიჯიტალი
{invoice_url}, {edit_cart_url}, {customer_note} დამატებითი action/info
{coupon_code}, {label_applied_coupon} coupon block
[order], [pending-order], [payment-actions], [shipping-info], [digital-downloads], [discountuse] პირობითი ბლოკები

Invoice page — cart/invoice.tpl

Tag / Block მნიშვნელობა
{shop_name}, {shop_email}, {shop_phone}, {shop_address} მაღაზიის დეტალები
{order_id}, {date}, {paymant}, {active} ინვოისის სათაური/სტატუსი
{name}, {email}, {phone} მყიდველი
{product} table rows
{subtotal}, {tax}, {shipping}, {discount_amount}, {total}, {currency} თანხები
{shipping_info}, {digital_downloads}, {coupon_code}, {label_applied_coupon} დამატებითი ბლოკები
[invoice], [shipping-info], [digital-downloads], [discountuse] პირობითი ბლოკები

User orders — cart/user.tpl, cart/user_orders_page.tpl

Tag მნიშვნელობა
{id}, {date} ორდერის ID/თარიღი
{products}, {item_count} პროდუქტების მოკლე სია
{status}, {status_color}, {delivery}, {paymethod} სტატუსები
{price}, {currency} თანხა
{order_url}, {invoice}, {pay} ბმულები
{orders_list} page wrapper-ში შეკვეთების ჩანაცვლება

10 Component templates და მათი ტეგები

Template Tags / Blocks
cart/cart_items.tpl {id}, {img}, {title}, {link}, {product_type}, {digital_badge}, {virtual_badge}, {attributes}, {qty}, {price}, {line_total}, {currency}, {label_unit_price}, {label_update}, {label_remove}
cart/order_item.tpl {img}, {title}, {link}, {product_type}, {digital_badge}, {virtual_badge}, {attributes}, {price}, {line_total}, {currency}
cart/product_actions.tpl {item_id}, {form_action}, {hidden_fields}, {button_label}, {in_cart_label}, {cart_qty}, {minus_action}, {minus_qty}, {minus_label}, {plus_label}, {remove_label}, {primary_button_style}, {secondary_button_style}, {remove_button_style}, {badge_style}, blocks: [not-in-cart], [in-cart], [show-qty-controls], [show-remove]
cart/product_attributes.tpl + product_attribute_item.tpl {count}, {items}, {name}, {value}
cart/shipping_info.tpl {shipping_address}, {shipping_region}, {delivery_status}, {store_phone}, blocks: [shipping-address], [shipping-region], [store-phone]
cart/digital_item.tpl {title}, {digital_message}, {download_url}, {download_label}, blocks: [digital-message], [download-button]
cart/empty.tpl {continue_url}, {empty_title}, {empty_message}, {label_go_home}

11 Payment / Notification templates

Payment templates

Template Tags
cart/paymethods/bog.tpl {bog_title}, {bog_details}, {bog_status_note}, {bog_action_url}, {bog_retry_url}, {bog_button_text}, {bog_autoredirect}
cart/paymethods/paypal.tpl {paypal_title}, {paypal_details}, {paypal_status_note}, {paypal_action_url}, {paypal_retry_url}, {paypal_button_text}
cart/paymethods/transfer.tpl {price}, {currency}, {requisites}
cart/paymethods/bank.tpl {bank_title}, {bank_details}, {bank_action_text}, {bank_action_url}
cart/paypal_checkout.tpl (legacy/optional) {client-id}, {paypallcurrency}, {order_id}, {order_url}, {product}, {total}, {currency}

Notification placeholders

Email/PM body-ში შეგიძლია გამოიყენო ტოკენები ქვემოთ. ისინი იგენერირება order event-იდან.

Placeholder აღწერა
{event_key}, {event_title}, {event_message} event ტიპი/სათაური/ტექსტი
{order_id}, {date} ორდერის დეტალი
{customer_name}, {customer_email}, {customer_phone}, {customer_address} მყიდველის მონაცემები
{payment_method}, {payment_status}, {delivery_status} სტატუსები
{subtotal}, {tax}, {shipping}, {discount_amount}, {total}, {currency} თანხები
{order_url}, {invoice_url} ლინკები
{shop_name}, {shop_email}, {shop_phone} მაღაზიის ინფორმაცია
{products_text}, {products_html} პროდუქტების ტექსტური/HTML სია

12 ყველაზე მნიშვნელოვანი პრაქტიკული წესები

  • აქტიური თემის main.tpl-ში აუცილებლად გქონდეს {cart_header}.
  • {product-button}-ის ფორმების class-ები არ შეცვალო: tx-add-to-cart-form / tx-cart-control-form.
  • cart.tpl და empty.tpl-ში დატოვე data-tx-cart-page, თორემ AJAX replace აღარ იმუშავებს.
  • {label_applied_coupon} გამოიყენე [discountuse] ბლოკში (cart/checkout/order/invoice).
  • stock limit სწორად მუშაობს მხოლოდ ფიზიკურ პროდუქტებზე; digital/virtual პროდუქტებზე ლიმიტი არ იჭრება.
  • თუ theme-ს ცვლი, templates/Default/cart/* შესაბამისად გადაიტანე შენს აქტიურ theme folder-ში.

გჭირდებათ დახმარება?

პასუხები ყველაზე ხშირად დასმულ კითხვებზე.

კონტაქტი