Flexdiscount - Settings

Through the settings You can control an additional informative block of discounts.

Settings page - Flexdiscount

Among the settings:

  1. "Discount rounding" - rounding is performed for each product, but not for the final discount.
  2. "Change product prices to discount prices" - if the product has a discount, its price will be changed. The price will become compare price (crossed out) and the discounted price will become the main. Prices will change in the sliders, categories and on the product page. Any changes to the template are not required.
    If you want to change prices on the cart page, you should
    Form has reached submission limit
    New html

    Price with discount on the cart page

    For custom output uses construction in general (don't use it in the template):

    {shopFlexdiscountPluginHelper::cartPrice($item, $mult_quantity = true, $html = null, $format = true, $update = true)},
    где $item - Array about product
        $mult_quantity - should we consider quantity or not in total product price,
        $html- ruble settings (1 - ruble sign, 0 - symbol rub.),
        $format - show price in currency or not,
        $update - use HTML wrapper for price updating
    

    In the template use construction:

    1) Find the following code in cart.html :

    {foreach $cart.items as $item}
    

    2) After it you can add to any place you need the code

    Output price based on quantity: {shopFlexdiscountPluginHelper::cartPrice($item)}
    Output price for one product: {shopFlexdiscountPluginHelper::cartPrice($item, 0)}
    

    Shop-Script changes cart prices by default, when you edit your order. If you don't want your price were replaced, do not embed the code above in constructions with classes: item-total or s-product-total.
    Either remove those classes either insert code into block with the same stylistic design.

    Form has reached submission limit
    .
  3. "Display flexdiscount coupon field" - add special field for coupons. Output place and display type can be changed.
    For custom output in any place of the template use code:
    {shopFlexdiscountPluginHelper::getCouponForm()}
        
  4. "Display affiliate bonus on the cart page" - display information about affiliate bonuses.
    Read about
    Form has reached submission limit
    New html

    Custom affiliate output

    For custom output uses construction in general (don't use it in the template):

    {shopFlexdiscountPluginHelper::getUserAffiliate($view_type)},
    where $view_type - View type.
    

    View type has two available values: 0 or 1. (Read more)

    In the template use construction:

    {shopFlexdiscountPluginHelper::getUserAffiliate(0)}
        or
    {shopFlexdiscountPluginHelper::getUserAffiliate(1)}
    

    Available variables:

    $fl_affiliate - total bonuses for order,
    $view_type - view type,
    $workflow = array( Full information about discounts and bonuses
        "discount" => total discount,
        "affiliate" => total bonuses for order,
        "rule_products" => array( Array of rules, which contains products, participating in discount 
            rule_id => array( The key is rule ID
                sku_id => array( The key is sku ID
                    "quantity" => quantity of products, participating in discount,
                    "discount" => total discount for rule,
                    "affiliate" => total affiliate for rule
                )
            )
        ),
        "products" => array( Array of products, participating in discount
            sku_id => array( The key is sku ID
                "total_affiliate" => total affiliate,
                "total_discount" => total discount,
                "affiliate" => affiliate for one product,
                "discount" => discount for one product,
                "rules" => array( Array of all rules, in which product was participating
                    rule_id => array( The key is rule ID
                        "quantity" => quantity of products, participating in discount,
                        "discount" => total discount for rule,
                        "affiliate" => total affiliate for rule
                    )
                )
            )
        ),
        "active_rules" => array( Additional information about rules
            rule_id => array(
                "name" => name of rule,
                "code" => symbolic code,
                "discount" => total discount for rule,
                "affiliate" => total affiliate for rule,
                "coupon_id" => whether you used the coupon, coupon ID,
                "coupon_code" => code of used coupon,
                "full_info" => array( Full information about rule (from admin page)
                    "id" => rule ID,
                    "name" => name of rule,
                    "code" => symbolic code,
                    "description" => rule description,
                    "conditions" => rule conditions,
                    "target" => rule targets,
                    "discount" => fixed discount,
                    "discount_currency" => discount currency,
                    "discount_percentage" => discount percentage,
                    "discounteachitem" => should we discount each item,
                    "affiliate" => affiliate,
                    "affiliate_percentage" => affiliate percentage,
                    "affiliateeachitem" => should we affiliate each item,
                    "discount_base" => discount base,
                    "limit" => array( Discount limitation
                        "status" => parameter exists, when limitation is active,
                        "price1" => first select field with price type,
                        "value" => price value,
                        "currency" => currency or percentage,
                        "price2" => second select field with price type,
                    ),
                    "maximum" => array( Maximum discount value
                        "value" => value,
                        "currency" => currency
                    ),
                    "maximum_affiliate" => maximum affiliate value
                )
            )
        )
    )
    
    Form has reached submission limit
    and shop setup.
  5. "Show active discount on the cart page" - this block contains discounts apply to order.
    Read about
    Form has reached submission limit
    New html

    Custom output of active discounts

    For custom output uses construction in general (don't use it in the template):

    {shopFlexdiscountPluginHelper::getUserDiscounts($view_type)},
    where $view_type - View type.
    

    View type has two available values: 0 or 1. (Read more)

    In the template use construction:

    {shopFlexdiscountPluginHelper::getUserDiscounts(0)}
        or
    {shopFlexdiscountPluginHelper::getUserDiscounts(1)}
    

    Available variables:

    $fl_discounts => array( Active discount rules
        rule_id => array( The key is rule ID
            "name" => name of rule,
            "code" => symbolic code,
            "discount" => total discount for rule,
            "affiliate" => total affiliate for rule,
            "coupon_id" => whether you used the coupon, coupon ID,
            "coupon_code" => code of used coupon,
            "full_info" => array( Full information about rule (from admin page)
                "id" => rule ID,
                "name" => name of rule,
                "code" => symbolic code,
                "description" => rule description,
                "conditions" => rule conditions,
                "target" => rule targets,
                "discount" => fixed discount,
                "discount_currency" => discount currency,
                "discount_percentage" => discount percentage,
                "discounteachitem" => should we discount each item,
                "affiliate" => affiliate,
                "affiliate_percentage" => affiliate percentage,
                "affiliateeachitem" => should we affiliate each item,
                "discount_base" => discount base,
                "limit" => array( Discount limitation
                    "status" => parameter exists, when limitation is active,
                    "price1" => first select field with price type,
                    "value" => price value,
                    "currency" => currency or percentage,
                    "price2" => second select field with price type,
                ),
                "maximum" => array( Maximum discount value
                    "value" => value,
                    "currency" => currency
                ),
                "maximum_affiliate" => maximum affiliate value
            )
        )
    ),
    $view_type - view type,
    $workflow = array( Full information about discounts and bonuses
        "discount" => total discount,
        "affiliate" => total bonuses for order,
        "rule_products" => array( Array of rules, which contains products, participating in discount 
            rule_id => array( The key is rule ID
                sku_id => array( The key is sku ID
                    "quantity" => quantity of products, participating in discount,
                    "discount" => total discount for rule,
                    "affiliate" => total affiliate for rule
                )
            )
        ),
        "products" => array( Array of products, participating in discount
            sku_id => array( The key is sku ID
                "total_affiliate" => total affiliate,
                "total_discount" => total discount,
                "affiliate" => affiliate for one product,
                "discount" => discount for one product,
                "rules" => array( Array of all rules, in which product was participating
                    rule_id => array( The key is rule ID
                        "quantity" => quantity of products, participating in discount,
                        "discount" => total discount for rule,
                        "affiliate" => total affiliate for rule
                    )
                )
            )
        ),
        "active_rules" => array( Additional information about rules
            rule_id => array(
                "name" => name of rule,
                "code" => symbolic code,
                "discount" => total discount for rule,
                "affiliate" => total affiliate for rule,
                "coupon_id" => whether you used the coupon, coupon ID,
                "coupon_code" => code of used coupon,
                "full_info" => array( Full information about rule (from admin page)
                    "id" => rule ID,
                    "name" => name of rule,
                    "code" => symbolic code,
                    "description" => rule description,
                    "conditions" => rule conditions,
                    "target" => rule targets,
                    "discount" => fixed discount,
                    "discount_currency" => discount currency,
                    "discount_percentage" => discount percentage,
                    "discounteachitem" => should we discount each item,
                    "affiliate" => affiliate,
                    "affiliate_percentage" => affiliate percentage,
                    "affiliateeachitem" => should we affiliate each item,
                    "discount_base" => discount base,
                    "limit" => array( Discount limitation
                        "status" => parameter exists, when limitation is active,
                        "price1" => first select field with price type,
                        "value" => price value,
                        "currency" => currency or percentage,
                        "price2" => second select field with price type,
                    ),
                    "maximum" => array( Maximum discount value
                        "value" => value,
                        "currency" => currency
                    ),
                    "maximum_affiliate" => maximum affiliate value
                )
            )
        )
    )
    
    Form has reached submission limit
    .
  6. "Show active product discounts" - this block displays the discounts on the product page, which will be applied (or already applied), if the customer will put a product to the cart.
    Read about
    Form has reached submission limit
    New html

    Custom output of active product discounts

    For custom output uses construction in general (don't use it in the template):

    {shopFlexdiscountPluginHelper::getProductDiscounts($product, $view_type = null, $sku_id = 0, $return_html = true)},
    where $product - Array about product, or product ID, or object shopProduct, 
        $view_type - View type,
        $sku_id - sku ID,
        $return_html - return HTML or array data
    

    View type has six available values: 1, 2, 3, 4, 5 or empty. (Read more)

    In the template use construction:

    1) Product page (product.html, product.cart.html):

    - No view type: {shopFlexdiscountPluginHelper::getProductDiscounts($product)}
    - View type 1: {shopFlexdiscountPluginHelper::getProductDiscounts($product, 1)}
    - Information about sku (you should know sku ID):
    {shopFlexdiscountPluginHelper::getProductDiscounts($product, 1, 5)}
    - Full information about discount in array:
    {shopFlexdiscountPluginHelper::getProductDiscounts($product, 2, 0, false)}
    

    2) Catalog (list-thumbs.html, catalog.html, product.list.html):

    Find code

    {foreach $products as $product} or {foreach $products as $p}
    
    If you have first case: {shopFlexdiscountPluginHelper::getProductDiscounts($product)}
    If you have second case: {shopFlexdiscountPluginHelper::getProductDiscounts($p)}
    

    Available variables:

    $fl_discounts => array( Array of rules, in which product is participating
        rule_id => array( The key is rule ID
            "discount" => discount for one product (in currency),
            "discount_html" => discount for one product with ruble sign,
            "clear_discount" => discount for one product without currencies,
            "affiliate" => affiliate for one product,
            "quantity" => quantity of product,
            "name" => rule name,
            "description" => rule description,
            "max_discount" => this value appears in the rule with the maximum discount,
            "max_affiliate" => this value appears in the rule with the maximum affiliate,
            "params" => array( Information about rule
                "discount" => fixed discount,
                "discount_currency" => discount currency,
                "discount_percentage" => discount percentage,
                "discounteachitem" => should we discount each item,
                "affiliate" => affiliate,
                "affiliate_percentage" => affiliate percentage,
                "affiliateeachitem" => should we affiliate each item,
                "code" => symbolic code,
            )
        )
    ),
    $view_type - view type,
    $workflow = array( Full information about discounts and bonuses
        "discount" => total discount (in currency),
        "discount_html" => total discount with ruble sign,
        "clear_discount" => total discount for one product without currencies,
        "affiliate" => total affiliate,
        "currency" => product currency,
        "price" => product price with discount (in currency),
        "price_html" => product price with discount with ruble sign,
        "clear_price" => product price with discount without currencies,
        "real_price" =>product price without discount (in currency),
        "product" => information about product,
        "items" => array( Array of rules, in which product is participating
            rule_id => array( The key is rule ID
                "discount" => discount for one product (in currency),
                "discount_html" => discount for one product with ruble sign,
                "clear_discount" => discount for one product without currencies,
                "affiliate" => affiliate for one product,
                "quantity" => quantity of product,
                "name" => rule name,
                "max_discount" => this value appears in the rule with the maximum discount,
                "max_affiliate" => this value appears in the rule with the maximum affiliate,
                "params" => array( Information about rule
                    "discount" => fixed discount,
                    "discount_currency" => discount currency,
                    "discount_percentage" => discount percentage,
                    "discounteachitem" => should we discount each item,
                    "affiliate" => affiliate,
                    "affiliate_percentage" => affiliate percentage,
                   "affiliateeachitem" => should we affiliate each item,
                    "code" => symbolic code,
                )
            )
        )
    )
    
    Form has reached submission limit
    .
  7. "Show available discounts" - this block displays information about all available discounts in store. The current setting allows you to utput block on the product page.
    You can set up filters to block:
    • Filter by user
      Displays discounts, available to current user. For example, wholesalers have special discounts. You don't want regular customers knew about the size of wholesale discounts. Then You turn on this option.
    • Filter by date
      Suppose You have planned all your discounts for the year ahead. You don't want all this information to be visible to the user. Then You turn on this option.
    Available discounts can be displayed in general, not only for current product. In this case, it displays only the names of Your discounts. You can output the block in any place of the template.
    Read about
    Form has reached submission limit
    New html

    Custom output of available discounts

    For custom output uses construction in general (don't use it in the template):

    {shopFlexdiscountPluginHelper::getAvailableDiscounts($product, $view_type = null, $sku_id = 0, $filter_by = array(), $return_html = true)},
    where $product - Array about product, or product ID, or object shopProduct 
        $view_type - View type,
        $sku_id - sku ID,
        $filter_by - Filters (user_group, date_group or any of conditions)
        $return_html - return HTML or array data
    

    View type has six available values: 1, 2, 3, 4 or empty. (Read more)

    In the template use construction:

    1) Product page (product.html, product.cart.html):

    - No view type: {shopFlexdiscountPluginHelper::getAvailableDiscounts($product)}
    - View type 1: {shopFlexdiscountPluginHelper::getAvailableDiscounts($product, 1)}
    - Information about sku (you should know sku ID):
    {shopFlexdiscountPluginHelper::getAvailableDiscounts($product, 1, 5)}
    - Filter by user: {shopFlexdiscountPluginHelper::getAvailableDiscounts($product, 2, 0, ['user_group'], false)}
    - Full information about discount in array:
    {shopFlexdiscountPluginHelper::getAvailableDiscounts($product, 2, 0, [], false)}
    

    2) Catalog (list-thumbs.html, catalog.html, product.list.html):

    Find code

    {foreach $products as $product} or {foreach $products as $p}
    
    If you have first case: {shopFlexdiscountPluginHelper::getAvailableDiscounts($product)}
    If you have second case: {shopFlexdiscountPluginHelper::getAvailableDiscounts($p)}
    

    3) Output in any place of the template

    - No view type: {shopFlexdiscountPluginHelper::getAvailableDiscounts()}
    - View type 1: {shopFlexdiscountPluginHelper::getAvailableDiscounts(null, 1)}
    

    Available variables:

    $fl_discounts => array( Array of rules, in which product is participating
        rule_id => array( The key is rule ID
            "discount" => discount for one product (in currency),
            "discount_html" => discount for one product with ruble sign,
            "clear_discount" => discount for one product without currencies,
            "affiliate" => affiliate for one product,
            "quantity" => quantity of product,
            "name" => rule name,
            "description" => rule description,
            "max_discount" => this value appears in the rule with the maximum discount,
            "max_affiliate" => this value appears in the rule with the maximum affiliate,
            "params" => array( Information about rule
                "discount" => fixed discount,
                "discount_currency" => discount currency,
                "discount_percentage" => discount percentage,
                "discounteachitem" => should we discount each item,
                "affiliate" => affiliate,
                "affiliate_percentage" => affiliate percentage,
                "affiliateeachitem" => should we affiliate each item,
                "code" => symbolic code,
            )
        )
    ),
    $view_type - view type,
    $fl_product - product information
    
    Form has reached submission limit
    .
  8. "Create page with available discounts in customer account" - for registered user you have account page. In this page you can display all user discounts. Also with the help of custom output You can display coupon form on the account page.
  9. "Show deny rules" - block, which has all deny rules for product. You can output deny rules for all products in any place of your template.
    Read about
    Form has reached submission limit
    New html

    Custom output of deny rules

    For custom output uses construction in general (don't use it in the template):

    {shopFlexdiscountPluginHelper::getDenyRules($product, $view_type = null, $sku_id = 0, $return_html = true)},
    where $product - Array about product, or product ID, or object shopProduct,
        $view_type - View type,
        $sku_id - sku ID,
        $return_html - return HTML or array data
    

    View type has two available values: 1 or empty. (Read more)

    In the template use construction:

    1) Product page (product.html, product.cart.html):

    - No view type: {shopFlexdiscountPluginHelper::getDenyRules($product)}
    - View type 1: {shopFlexdiscountPluginHelper::getDenyRules($product, 1)}
    - Information about sku (you should know sku ID):
    {shopFlexdiscountPluginHelper::getDenyRules($product, 1, 5)}
    

    2) Catalog (list-thumbs.html, catalog.html, product.list.html):

    Find code

    {foreach $products as $product} or {foreach $products as $p}
    
    If you have first case: {shopFlexdiscountPluginHelper::getDenyRules($product)}
    If you have second case: {shopFlexdiscountPluginHelper::getDenyRules($p)}
    

    3) Output in any place of the template

    {shopFlexdiscountPluginHelper::getDenyRules()}
    

    Available variables:

    $fl_deny_rules => array( Array of deny rules
        rule_id => array( The key is rule ID
            "name" => rule name,
            "code" => symbolic code,
        )
    ),
    $view_type - view type
    
    Form has reached submission limit
    .
  10. "Display price with discount on product page" - block that appears if the product has discount. This block is a simplified version of the Active product discounts.
    Read about
    Form has reached submission limit
    New html

    Custom output of price of discount

    For custom output uses construction in general (don't use it in the template):

    {shopFlexdiscountPluginHelper::price($product, $sku_id = 0, $view_type = null},
    где $product - Array about product, or product ID, or object shopProduct, 
        $sku_id - sku ID,
        $view_type - View type   
    

    View type has two available values: 1 or empty. (Read more)

    In the template use construction:

    1) Product page (product.html, product.cart.html):

    - No view type: {shopFlexdiscountPluginHelper::price($product)}
    - Information about sku (you should know sku ID):
    {shopFlexdiscountPluginHelper::price($product, 1)}
    - View type 1: {shopFlexdiscountPluginHelper::price($product, 0, 1)}
    

    2) Catalog (list-thumbs.html, catalog.html, product.list.html):

    Найдите фрагмент кода

    {foreach $products as $product} или {foreach $products as $p}
    
    Если у Вас первый случай: {shopFlexdiscountPluginHelper::price($product)}
    Если у Вас второй случай: {shopFlexdiscountPluginHelper::price($p)}
    

    Find code

    $fl_price => product price with discount without currencies,
    $view_type - view type,
    $workflow = array( Full information about discounts and bonuses
        "discount" => total discount (in currency),
        "discount_html" => total discount with ruble sign,
        "clear_discount" => total discount for one product without currencies,
        "affiliate" => total affiliate,
        "currency" => product currency,
        "price" => product price with discount (in currency),
        "price_html" => product price with discount with ruble sign,
        "clear_price" => product price with discount without currencies,
        "real_price" =>product price without discount (in currency),
        "product" => information about product,
        "items" => array( Array of rules, in which product is participating
            rule_id => array( The key is rule ID
                "discount" => discount for one product (in currency),
                "discount_html" => discount for one product with ruble sign,
                "clear_discount" => discount for one product without currencies,
                "affiliate" => affiliate for one product,
                "quantity" => quantity of product,
                "name" => rule name,
                "params" => array( Information about rule
                    "discount" => fixed discount,
                    "discount_currency" => discount currency,
                    "discount_percentage" => discount percentage,
                    "discounteachitem" => should we discount each item,
                    "affiliate" => affiliate,
                    "affiliate_percentage" => affiliate percentage,
                   "affiliateeachitem" => should we affiliate each item,
                    "code" => symbolic code,
                )
            )
        )
    )
    
    Form has reached submission limit
    .

All block can be edited. Using different view types, You can change the appearance of blocks on different pages, output blocks with different information for different storefronts or users.

Learn more about special offers right now!