During this I noticed that, as the title suggests, when you add a variant to the cart, the oc system does a switch and adds the parent/master instead, but with the options specified in the variant.
Im not sure this is the best way, and may even be a mistake, as by adding the master into cart from that point on you loose all overridden fields that may be set in the variant, such as name, model etc. etc.
So in cart, checkout, order notifications, order history and product reordering that data is lost, in fact there is no record which variant product was "ordered" to begin with.
This seems to make no sense seems there is in fact a master_id field in order_product table, showing intention to store a variant product there, but it will never be used with the current method.
I even found out the add to cart system work perfectly fine for adding variants into the cart and checking out and re-ordering, if you comment out the code that switches the variant product id for its master id on add.
I created an issue on github to discuss this potential bug, among a bunch of other more obvious bugs related to variants, some breaking the system so bad its clear no-one is really using it, otherwise they would have been reported by now... and what do you know Daniel just says that is the way its meant to be, and that i shouldnt be bringing this (a potential bug) up here and closes the report... I ask again, why is there a master_id field in the order_product table ? (which seems to be in stark contrast to the "its perfect, go away" response from Daniel) Im not expecting a reply, but im just trying to help, I thought that was the spirit behind opensource, but i guess im just being idealistic In fact ive been watching his behaviour in github to others just trying to help, and sadly its very rude and non-informative.
Anyway I made this post here to make record for anyone else wondering about the topic, to help this community and see what you think about it, maybe the behavior could be an admin option if its agreed that both ways have their uses ?
Here is my bug report which shows the one line that needs to be commented out, so the variant goes into cart instead of master. https://github.com/opencart/opencart/issues/12338
OC version. The addressed Github Opencart commit on the above has been closed already.haydent wrote: ↑Thu Jun 01, 2023 4:10 amHi, Ive been investigating the variant system and using it our website to create different models assigned to different option configs.
During this I noticed that, as the title suggests, when you add a variant to the cart, the oc system does a switch and adds the parent/master instead, but with the options specified in the variant.
Im not sure this is the best way, and may even be a mistake, as by adding the master into cart from that point on you loose all overridden fields that may be set in the variant, such as name, model etc. etc.
So in cart, checkout, order notifications, order history and product reordering that data is lost, in fact there is no record which variant product was "ordered" to begin with.
This seems to make no sense seems there is in fact a master_id field in order_product table, showing intention to store a variant product there, but it will never be used with the current method.
I even found out the add to cart system work perfectly fine for adding variants into the cart and checking out and re-ordering, if you comment out the code that switches the variant product id for its master id on add.
I created an issue on github to discuss this potential bug, among a bunch of other more obvious bugs related to variants, some breaking the system so bad its clear no-one is really using it, otherwise they would have been reported by now... and what do you know Daniel just says that is the way its meant to be, and that i shouldnt be bringing this (a potential bug) up here and closes the report... I ask again, why is there a master_id field in the order_product table ? (which seems to be in stark contrast to the "its perfect, go away" response from Daniel) Im not expecting a reply, but im just trying to help, I thought that was the spirit behind opensource, but i guess im just being idealistic In fact ive been watching his behaviour in github to others just trying to help, and sadly its very rude and non-informative.
Anyway I made this post here to make record for anyone else wondering about the topic, to help this community and see what you think about it, maybe the behavior could be an admin option if its agreed that both ways have their uses ?
Here is my bug report which shows the one line that needs to be commented out, so the variant goes into cart instead of master. https://github.com/opencart/opencart/issues/12338
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Some features might of been changed by design. It's possible.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Compare the codes with the master branch or replace the specific files to see if the issue has already been fixed.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Then, produce a video to describe on how you believe the reported issue might be a bug.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
- there is a master_id field in the order_product table
- adding master looses all variant override details which then cant be used for checkout/reorder/order history/order notification the list goes on
If you believe it to be unnecessary, then you are only trying to prove a point on a closed case.haydent wrote: ↑Sun Jul 16, 2023 5:37 amthat is unnecessary and overkill, its simple 2 example reasons:
- there is a master_id field in the order_product table
- adding master looses all variant override details which then cant be used for checkout/reorder/order history/order notification the list goes on
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
It ain't the topic for anyone since the commit you already addressed the issue about on Github, and now as a feedback, was closed for. Therefore, if you'd like to re-address the issue, please do so on Github.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
There is NO commit you talk about.
There is a git issue I initially created before this thread to try and deal with it that way, but Daniel just disregarded me completely and closed it as he does commonly.
There is no point opening another issue on git, it will just be closed again with no response.
The problem has not been fixed.
That is the point I was mentioning on the above, so you did created an issue about it but has been closed already.haydent wrote: ↑Mon Jul 17, 2023 6:08 amI still dont think YOU understand my opening post and the reason for this thread.
There is NO commit you talk about.
There is a git issue I initially created before this thread to try and deal with it that way, but Daniel just disregarded me completely and closed it as he does commonly.
There is no point opening another issue on git, it will just be closed again with no response.
The problem has not been fixed.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Code: Select all
$product_id = $product_info['master_id'];
I wasn't really looking for solutions, I was making this thread to highlight Daniels inability to discuss what in my opinion is clearly a mistake / missed opportunity. And to see what others think about his decision to not change this.
Users browsing this forum: No registered users and 24 guests