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

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...

Important Information

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