Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Easy Populate 2.78 With Sppc + Price Breaks


adz1976

Recommended Posts

Hi

 

My Setup

OSC MS2

SPPC v4.1 + price breaks

Easy Populate v2.78 + SPPC + price breaks

SQLv5.0

 

Hope you can help

 

I have already left a post for this problem but nobody has left any replies.

So this time I have included some code so you can see my problem.

 

This is what I am trying to do:

 

This code has come from Easy Populate v2.78 with SPPC + price breaks

 

What am I trying to do ?

 

The upload through EP of the complete customer prices all works fine

BUT

what I would like to do is just upload a specific customers prices.

 

I.E.

There are 5 customers but I only want to upload customer 3's prices.

 

As you can see at the start of the code it deletes all products id & prices out of the TABLE_PRODUCTS_GROUPS before it uploads the new data, this is why when I try to upload just 1 customers prices it wipes out all the other customer prices.

 

If I delete the following section out of the code & try to upload my prices it comes up with a duplication error

 

// they spec'd some prices, so clear all existing entries

$result = tep_db_query('

DELETE

FROM

'.TABLE_PRODUCTS_GROUPS.'

WHERE

products_id = ' . $v_products_id

);

 

I realise it is having to delete the data out of TABLE_PRODUCTS_GROUPS before it can upload the new prices.

 

BUT

 

Is there a way to change the code so it will just replace the prices instead of it deleting them ?

 

 

Code Below:

 

// they spec'd some prices, so clear all existing entries

$result = tep_db_query('

DELETE

FROM

'.TABLE_PRODUCTS_GROUPS.'

WHERE

products_id = ' . $v_products_id

);

// and insert the new record

if ($v_customer_price_1 != ''){

$result = tep_db_query('

INSERT INTO

'.TABLE_PRODUCTS_GROUPS.'

VALUES

(

' . $v_customer_group_id_1 . ',

' . $v_customer_price_1 . ',

' . $v_products_id . ',

' . $v_products_price1_1 . ',

' . $v_products_price2_1 . ',

' . $v_products_price3_1 . ',

' . $v_products_price4_1 . ',

' . $v_products_price5_1 . ',

' . $v_products_price6_1 . ',

' . $v_products_price7_1 . ',

' . $v_products_price8_1 . ',

' . $v_products_price1_qty_1 . ',

' . $v_products_price2_qty_1 . ',

' . $v_products_price3_qty_1 . ',

' . $v_products_price4_qty_1 . ',

' . $v_products_price5_qty_1 . ',

' . $v_products_price6_qty_1 . ',

' . $v_products_price7_qty_1 . ',

' . $v_products_price8_qty_1 . ',

' . $v_products_qty_blocks_1 . '

)'

);

}

if ($v_customer_price_2 != ''){

$result = tep_db_query('

INSERT INTO

'.TABLE_PRODUCTS_GROUPS.'

VALUES

(

' . $v_customer_group_id_2 . ',

' . $v_customer_price_2 . ',

' . $v_products_id . ',

 

and so on.....

 

Really hope someone can help me with this :-)

 

Thanks

 

Adam

Link to comment
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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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