RaVeR76 / The-Kicks-Fix

Are you tired of searching for your kicks online? Well, look no further my friend ........ The Kicks Fix has you covered :)
1 stars 2 forks source link

Adding To Bag Problems #21

Closed RaVeR76 closed 2 years ago

RaVeR76 commented 2 years ago

I couldn't get the bag to add both Kicks & Accessories. I couldn't work it out as I was using SKU for both products when added to bag so it was causing all sorts of errors when I was checking an Accessory SKU within the Kicks database & vice versa. In the end I figured a method out which might not be right or the best way but it works for now

RaVeR76 commented 2 years ago

Within bag_contents in the contexts.py, as I was using SKU because of the bug (BUG20) above where the two different products had many of the same PKs I needed to differentiate between the two SKUs. By luck I didn't have any proper SKUs for my Accessories I found online so made these up & they all started with 'RAVE' ha ha. So I just added a wee bit of code to check if the item_id in the bag had the word 'RAVE' in it. If it didn't have 'RAVE' it was a Kicks item so I get the object from my Kicks db & if it did have 'RAVE' it was an Accessory item so I get the object from my Accessories db. Talk about a stroke of luck tbh as my head was about to explode on this bug !!! (This code was removed at a later date btw as I utilised the fact that my Kicks would have sizes & my Accessories would not which made it a little easier to work with)