get discount_id

  • Posts: 120
  • Thank you received: 2
11 years 1 month ago #164048

Hi dear
I need get product discount_id from #__hikashop_discount table in database.
how can get discount_id a product use which discount?
thank you

Last edit: 11 years 1 month ago by kaya.

Please Log in or Create an account to join the conversation.

  • Posts: 26274
  • Thank you received: 4045
  • MODERATOR
11 years 1 month ago #164052

Hi,

It depends on your discount.
You can have discount apply on a single product or discount applyed on categories (and sub categories too).

So the way to retrieve them is different depending the discount configuration.

We will need more details in order to answer you correctly.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: kaya

Please Log in or Create an account to join the conversation.

  • Posts: 120
  • Thank you received: 2
11 years 1 month ago #164089

Thank you dear Jerome
My discount apply on a single product and I create many discount and a single product use a one discount.
now I need get discount_id for each product. how can get it?

Please Log in or Create an account to join the conversation.

  • Posts: 120
  • Thank you received: 2
11 years 1 month ago #164095

I use this code and its work now

$product_id =  (int)trim( $params->get('product_id') );
$query="SELECT discount_percent_amount,discount_flat_amount FROM `#__hikashop_discount` WHERE discount_product_id=$product_id";

Please Log in or Create an account to join the conversation.

Time to create page: 0.059 seconds
Powered by Kunena Forum