Jump to content

get Cart Rule restrictions in PHP


hakeryk2

Recommended Posts

Hey devs,

Is there is any way to get CartRule (voucher) restrictions listed in PHP? I wan't to see for example for which manufacturers code is available or maybe for which categories it is active only. How to get this informations in PHP? I tried with CartRule::getCartsRuleByCode('CODE') but it just gives me a simple informations about voucher. How about this list of selected ie: manufacturers? Maybe some SQL query?

Link to comment
Share on other sites

Nope, it gives me almost the same result as CartRule::getCartsRuleByCode('CODE'); for example:

   [id] => 33
    [name] => Array
        (
            [1] => Your description of your voucher
        )

    [id_customer] => 0
    [date_from] => 2016-11-25 09:00:00
    [date_to] => 2020-03-28 09:00:00
    [description] => 
    [quantity] => 53
    [quantity_per_user] => 5
    [priority] => 2
    [partial_use] => 1
    [code] => YOURCODE
    [minimum_amount] => 1000.00
    [minimum_amount_tax] => 1
    [minimum_amount_currency] => 1
    [minimum_amount_shipping] => 0
    [country_restriction] => 1
    [carrier_restriction] => 0
    [group_restriction] => 0
    [cart_rule_restriction] => 1
    [product_restriction] => 1
    [shop_restriction] => 0
    [free_shipping] => 1
    [reduction_percent] => 0.00
    [reduction_amount] => 0.00
    [reduction_tax] => 0
    [reduction_currency] => 1
    [reduction_product] => 0
    [gift_product] => 0
    [gift_product_attribute] => 0
    [highlight] => 1
    [active] => 1
    [date_add] => 2016-11-25 09:13:30
    [date_upd] => 2018-09-27 15:28:48
    [id_lang:protected] => 
    [id_shop:protected] => 
    [id_shop_list] => 

but it doesn't containt information about restriction which ie: manufacturers or categories are included or excluded from this voucher.

It contains informations like minimum_amount or is it restricted like country or product restriction but I really want to get these restriction into variable.

 

 

Link to comment
Share on other sites

  • 1 year later...
  • 7 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...