Shopping Basket

 x 

Cart empty


Log In

Find Us Elsewhere

SSL

Forum Search

Keyword

GoogleBaseXML & VM Version Recognition

  • 4FootyFans
  • 4FootyFans's Avatar Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
More
5 years 1 month ago #2989 by 4FootyFans
GoogleBaseXML & VM Version Recognition was created by 4FootyFans
Hello

We are still on VM 2.0.26d

However, I have added and populated the fields product_gtin + product_mpn into virtumart_products table.

There is also a GTIN custom field.

If I 'switch off' the custom field, should the component then recognise the product_gtin field in my VM version or does it need to be able to recognise VM 2.6.?

I tried this yesterday and ran the feed. Even with the custom field switched off, it did not insert GTINs that were in the product_gtin field but not in the custom field.

So, have I answered my own question?

The jotcache component is also in use. I cleared that out but still the same.

Thanks

Please Log in or Create an account to join the conversation.

More
5 years 1 month ago #2990 by boggler
Replied by boggler on topic GoogleBaseXML & VM Version Recognition
Hello, the product feed does not assume anything about the version when detecting the gtin, it just detects whether the database field is populated, what you are describing should work. The code that handles this is in components/com_googlebasexml/models/googlebasexml.php lines 811 to 816, it says
if(isset($product->product_gtin) && !empty($product->product_gtin))
			{
					$items[$i]->gtin = $product->product_gtin;
			}
			else
                  {
                         ..only do something else if the product_gtin field is not populated
                  }

You can see that if the product_gtin field is populated then it should definitely be used. Same for mpn.

This code has been thoroughly tested and definitely works in VM 2.6+ to correctly pick up the gtin and mpn so I think that something has to be going wrong in your testing. Unfortunately it is just a matter of going through everything and double checking. Have you definitely got the field names correct? eg it must be product_gtin not product_GTIN etc.

But it is an interesting idea to do things this way, much easier than creating a custom field if you are looking at importing the data rather than adding it manually.

Please Log in or Create an account to join the conversation.

More
5 years 1 month ago - 5 years 1 month ago #2991 by boggler
Replied by boggler on topic GoogleBaseXML & VM Version Recognition
Just to check with you, which version of GooglebaseXML are you using? The code for detecting the gtin has been the same for a while but if you are using an older version perhaps it has not been added.
Last edit: 5 years 1 month ago by boggler.

Please Log in or Create an account to join the conversation.

  • 4FootyFans
  • 4FootyFans's Avatar Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
More
5 years 1 month ago #2992 by 4FootyFans
Replied by 4FootyFans on topic GoogleBaseXML & VM Version Recognition
Hello

Thanks for the info & comments.

I replicated the 2 new fields from a 2.6 db.

The product_gtin field is populated as we previously did have a field called product_barcode which is automatically populated from a feed. I copied over the contents of product_barcode to product_gtin.

I have attached 2 screen shots of the 2 new fields.

I'll try in com.googlebasexml to switch off the custom fields for a 48 hour period to see what happens when new products with gtins are added to the db..
Attachments:

Please Log in or Create an account to join the conversation.

  • 4FootyFans
  • 4FootyFans's Avatar Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
More
5 years 1 month ago #2993 by 4FootyFans
Replied by 4FootyFans on topic GoogleBaseXML & VM Version Recognition
v4.5.1

Please Log in or Create an account to join the conversation.

  • 4FootyFans
  • 4FootyFans's Avatar Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
More
5 years 1 month ago #2994 by 4FootyFans
Replied by 4FootyFans on topic GoogleBaseXML & VM Version Recognition
I've checked the file you referred to and the lines are present.......

Please Log in or Create an account to join the conversation.

More
5 years 1 month ago #2995 by boggler
Replied by boggler on topic GoogleBaseXML & VM Version Recognition
Yes, that is the most recent version. Your method definitely should work then.
The following user(s) said Thank You: 4FootyFans

Please Log in or Create an account to join the conversation.

  • 4FootyFans
  • 4FootyFans's Avatar Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
More
5 years 1 month ago #2996 by 4FootyFans
Replied by 4FootyFans on topic GoogleBaseXML & VM Version Recognition
Thanks.

Cannot check until some more new products are added, today or Monday.

Please Log in or Create an account to join the conversation.

More
5 years 1 month ago #2997 by boggler
Replied by boggler on topic GoogleBaseXML & VM Version Recognition
It may also help to add the new database fields to the table definition that Virtuemart uses for the products table. The feed uses Virtuemart's internal products model to get the product info, rather than just lifting it straight from the database, it is possible that Virtuemart is not correctly picking these fields up. To do this go to file administrator/components/com_virtuemart/tables/products.php, where it has:
class TableProducts extends VmTable {

	/** @var int Primary key */
	var $virtuemart_product_id	 = 0;
	/** @var integer Product id */
	var $virtuemart_vendor_id = 0;
	/** @var string File name */

add
class TableProducts extends VmTable {
     var $product_gtin = null;
     var $product_mpn = null;

	/** @var int Primary key */
	var $virtuemart_product_id	 = 0;
	/** @var integer Product id */
	var $virtuemart_vendor_id = 0;
	/** @var string File name */

I can't promise that it will solve your problem but there is a chance.

Please Log in or Create an account to join the conversation.

  • 4FootyFans
  • 4FootyFans's Avatar Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
More
5 years 1 month ago #2998 by 4FootyFans
Replied by 4FootyFans on topic GoogleBaseXML & VM Version Recognition
Done!

Please Log in or Create an account to join the conversation.

  • 4FootyFans
  • 4FootyFans's Avatar Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
More
5 years 4 weeks ago #2999 by 4FootyFans
Replied by 4FootyFans on topic GoogleBaseXML & VM Version Recognition
Good Morning

It appears that the feed is now working correctly with the new fields added.

If only we could now get our distributor to allocate 100% correct gtins.

Thanks for your assistance and advice

Best

Please Log in or Create an account to join the conversation.

Moderators: boggler
Time to create page: 0.344 seconds

Donate to Us

If you like our extensions, consider making a donation to say thanks.