I'm working on a magento product page. On this page I show a block of HTML that references a separate product that can be added to cart. This is somewhat 'faking' a related item. On the product being viewed, I've added a new attributed called crosssell_item. This contains a value for my external product ID, not the magento ID.
How do I add an add to cart button that looks at this crosssell_item attribute value, finds the magento product that has the same value in it's SKU attribute, and then returns that items's magento ID so I can add it to cart?
Example:
- SKU attribute value = 104704; has magento ID of 12345
- Cross sell attribute value = 105846
- SKU of cross sell value = 105846; has magento ID of 45678
I want to display an add to cart button so the fake cross sell item can be purchased from the product page of the SKU.
Thanks!