bluevisiontec / GoogleShoppingApi

Magento Module GoogleShoppingApi v2
Open Software License 3.0
69 stars 45 forks source link

Use Rewrites & Map child products to parent URL #60

Closed behunin closed 9 years ago

behunin commented 9 years ago

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.

schnere commented 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?

behunin commented 9 years ago

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

schnere commented 9 years ago

Why don't you just upload the parent product?