Does anyone know what PHP file adds the items to the shopping cart ?
Printable View
Does anyone know what PHP file adds the items to the shopping cart ?
What are you wanting to do?
I want to see how the items are added to the shopping cart in PHP. I want to add extra data. i.e. manufacturers_id so I can access it in the shipping module and then look up the manufacturers table using it as the key.
You can look up a product's manufacturer's id in your shipping module - no need to change the add to cart behavior. The function zen_get_products_manufacturers_id($prid) will get the manufacturer for product id $prid.
Hey that function zen_get_products_manufacturers_id($prid) to get the manufacturer for product id $prid actually worked.
Thanks for that. One more step along the long and winding road.
Having solved that problem, I now want to be able to query the manufacturers table using that manufacturers_id as the key.
I need a custom query to do this, as I have added an extra field called Man_PostCode in the manufacturers table that I want to extract into a variable. Thus I don't think any standard function will exist to extract that. Any ideas on how to do that ?
Thanks.
The directory includes/functions/extra_functions exists so you can add custom functions like the one you're describing. Use the function I pointed you to as a model for your new function.
OK Thanks. I will give it a try.
I don't really know PHP very well. So what PHP file name do I put this extra function in and how do I inlcude it to be called from the shipping module ?
i.e. in directory includes/functions/extra_functions
I've got it working, but in the main functions module until I can work out how to apply it in the extra_functions directory. Apart from that, its working.
The filename for files in the /extra_functions/ folder is irrelevant; it only serves to be able to locate the right file if you want to edit it. All files there are autoloaded.