Closed behunin closed 9 years ago
Please explain further what are you trying to do.
It seems that you want to submit the category link of the product instead of the product detail page? And you don't care about simple products which don't have parent products?
I don't think that I can merge your PR...
Furthermore you if statements are not correct:
if($product->getTypeId() == 'simple' && $parentItem->getTypeId() == 'configurable' || 'bundle' || 'grouped') {
should be
if($product->getTypeId() == 'simple' && ( $parentItem->getTypeId() == 'configurable' || $parentItem->getTypeId() == 'bundle' || $parentItem->getTypeId() == 'grouped' )) {
And why do you use sprintf to concatenate a string?
I know this is rough code so please excuse the PR... I am still learning Magento...
I want to map the google shopping link to the parent product URL, if a parent exists. If not then map to the simple product I want the URL generated to be the SEO rewritten URL if rewrites are enabled. I concatenate the rewritten url with sprintf because again, I am knew to magento and not sure what the best coding practices are let alone how to make a proper if statement lol
Why don't you just upload the parent product?
My test have returned working rewriten urls for the $parentItem but not for the $childItem. $childItem Urls return like http://example.com//?__store=default&utm_source=GoogleShopping. Please advise.