Jump to content

Recommended Posts

the same product but different id in the cart. does anyone have any idea why?

https://xxx.de/product_info.php?products_id=32{21}17{16}1{1}1{18}1{15}1{17}1{4}1{23}1{10}1{12}1{20}1{19}1{11}1{9}1{3}1{8}1{2}1{14}1{22}1{13}1 
https://xxx.de/product_info.php?products_id=32{21}17{15}1{17}1{16}1{1}1{18}1{14}1{22}1{13}1{4}1{23}1{10}1{12}1{20}1{19}1{11}1{9}1{3}1{8}1{2}1

 

Share this post


Link to post
Share on other sites
1 hour ago, YePix said:

the same product but different id in the cart. does anyone have any idea why?


https://xxx.de/product_info.php?products_id=32{21}17{16}1{1}1{18}1{15}1{17}1{4}1{23}1{10}1{12}1{20}1{19}1{11}1{9}1{3}1{8}1{2}1{14}1{22}1{13}1 
https://xxx.de/product_info.php?products_id=32{21}17{15}1{17}1{16}1{1}1{18}1{14}1{22}1{13}1{4}1{23}1{10}1{12}1{20}1{19}1{11}1{9}1{3}1{8}1{2}1

 

Apparently the attributes strings are not generated in any sequence.

Nevertheless, both products are identified by the same id=32. If your intention is to use this id number to check the status of the products, then try this to capture only the id and ignore the attributes:

Quote

$pID= current(explode("{", $products[$i]['id']));   //this returns the product_id only, e.g. 32

 

Share this post


Link to post
Share on other sites

Fetching the products without paying the line is the one thing, how do I get that these characters are not written to the CUSTOMERS_BASCET as products_id? i need a pure products_id Can someone help me with this?

Share this post


Link to post
Share on other sites
21 minutes ago, YePix said:

how do I get that these characters are not written to the CUSTOMERS_BASCET as products_id?

The easy way would be to just remove all the attributes from the product.  Then it will save with a simple product ID. 

If you don't want to remove the attributes, then you don't want to remove those characters, as they specify which attributes were chosen.  If you save to customers_basket without those characters, you will remove all the attribute choices from that product. 

If you want to convert from and to the long form, you can use tep_get_prid and tep_get_uprid. 


Always backup before making changes.

Share this post


Link to post
Share on other sites

no, that's not true. have just manually changed the products_id in the db for the same product with different attributes and everything works fine. the CUSTOMERS_BASCET stores the products_id and the rest in the CUSTOMERS_BASCET_ATTRIBUTES. thus it is unnecessary to save the string after the products_id

Share this post


Link to post
Share on other sites

the customers_bascet_id is responsible for the sorting of the products in CUSTOMERS_BASKET and the attributes are assigned to the products_id and therefore the same product is stored individually. I can not find only the code where the products_id writes in the CUSTOMERS_BASCET

Share this post


Link to post
Share on other sites

@ecartz You were right. But now in the general.php I've swapped the (int)$option with (int)$prid and everything works perfect

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

×