Hi,
This is my first post on these forums so go easy on me!
I have recently installed Opencart 2.3.0.2 moving from a very old oscommerce site. So far, I am really impressed!
One thing I was hoping someone could help with is the googlebase (merchant) feed.
On my products I have added a custom attribute 'Condition' and have entered either 'New' or 'Used' when listing products. I was hoping I may be able to edit the googlebase feed to pick this up, rather than it passing 'New' for every product.
Can someone help with the code I need to change to make this happen?
Many thanks, Lee.
Welcome, Lee! No worries, we're all here to help each other out.
To customize the Google Base feed to include your custom 'Condition' attribute, you'll need to modify the product feed code. Here's a general approach:
Locate the Feed Code: Find the code responsible for generating the Google Base feed in your OpenCart store. This is usually in the feeds folder.
Edit the Code: Open the relevant PHP file (e.g., googlebase.php) and locate the section where product attributes are added to the feed. You'll need to add a condition to check for your custom 'Condition' attribute and include it in the feed Marlboro Rewards
Here's a basic example of how you might modify the code:Save and Test: Save your changes and test the feed to ensure the 'Condition' attribute is correctly included.
Save and Test: Save your changes and test the feed to ensure the 'Condition' attribute is correctly included.
To customize the Google Base feed to include your custom 'Condition' attribute, you'll need to modify the product feed code. Here's a general approach:
Locate the Feed Code: Find the code responsible for generating the Google Base feed in your OpenCart store. This is usually in the feeds folder.
Edit the Code: Open the relevant PHP file (e.g., googlebase.php) and locate the section where product attributes are added to the feed. You'll need to add a condition to check for your custom 'Condition' attribute and include it in the feed Marlboro Rewards
Here's a basic example of how you might modify the code:Save and Test: Save your changes and test the feed to ensure the 'Condition' attribute is correctly included.
Code: Select all
foreach ($products as $product) {
$feed[] = array(
'title' => $product['name'],
'link' => $product['href'],
'condition' => $product['condition'], // Add this line
// Other attributes...
);
}
I believe the original poster had solved this issue over 7 years agodora87booth wrote: ↑Fri Dec 27, 2024 5:55 pmWelcome, Lee! No worries, we're all here to help each other out.
Got an urgent question that’s keeping you up at night? There might just be a magical inbox ready to help: khnaz35@gmail.com
Enjoy nature
Who is online
Users browsing this forum: No registered users and 3 guests