Jump to content
dwi

(solved) tanya harga khusus di harga produk

Recommended Posts

halo para master, mw tanya bagaimana cara update harga produk dimana mendapatkan harga khusus (diskon) 5% untuk diatas 1 juta, selain itu 0% dalam satu kategori barang. klo update satu2 bisa, cuma barangnya dah ribuan... Apakah ada cara via sql ato cara lain yg bisa update sekaligus?

Edited by dwi (see edit history)

Share this post


Link to post
Share on other sites

solusi dah saya dapat dengan cara eksekusi SQL di php my admin

*untuk id_category_default list nya tinggal lihat di BO katalog > kategori

===============================================================================

(script untuk menampilkan category yang diminta dg harga lebih dari 1 juta)

select 
        ps_product_shop.id_product, ps_product_shop.id_category_default, ps_product_shop.price, ps_specific_price.reduction,  ps_specific_price.reduction_type

from     ps_specific_price
        JOIN 
        ps_product_shop
            on ps_specific_price.id_product = ps_product_shop.id_product
        JOIN 
        ps_product
            on ps_product_shop.id_category_default=ps_product.id_category_default

WHERE ps_product_shop.id_category_default = 194 and ps_product_shop.price > 1000000

================================================================================

(script untuk update harga khusus/diskon 5% untuk harga lebih dari 1 juta)

UPDATE 
        ps_specific_price

        JOIN 
        ps_product_shop
            on ps_specific_price.id_product = ps_product_shop.id_product
        JOIN 
        ps_product
            on ps_product_shop.id_category_default=ps_product.id_category_default
            
 set ps_specific_price.reduction = 0.05

WHERE ps_product_shop.id_category_default = 194 and ps_product_shop.price > 1000000

================================================================================

untuk harga 1 juta atau kurang tinggal diganti reduction = 0 dan price nya <= 1000000

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More