Shopping Basket


Cart empty

Log In

Find Us Elsewhere


Forum Search


XML Feed: Tags with Field Names in Camel Case?

  • znetworks
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
8 years 1 month ago #307 by znetworks
I have a custom XML Feed based on GoogleBaseXML to continually update/transfer information to a custom made website. The XML Feed is working except I would like the field names in the Feed to be in Camel Case, as opposed to all uppercase word starts or all lowercase word starts. (ie productName, not productname or ProductName)

I have tried adding some PHP functions to convert the XML Feed to Camel Case tags, but it disregards the code and reverts back to the standard format.

Any advice or a possible solution, or any PHP code I can add in to convert the tags would be very much appreciated.

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

8 years 1 month ago #308 by boggler
The xml tag names are defined in the file components/com_googlebasexml/models/googlebasexml.php.

Look for the function getTags() - if you are using a version of the component prior to 2.0.0 then it will be around line 870, if you are using 2.0.0 then it is around line 1100.

The function is self-explanatory, it simply defines the tag names, eg
$tags->description = 'description';
		$tags->id = 'g:id';	
		$tags->link = 'link';	
		$tags->price = 'g:price';
		$tags->sale_price = 'g:sale_price';
		$tags->sale_price_effective = 'g:sale_price_effective_date';

You can change the values to whatever you want.

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

Moderators: boggler
Time to create page: 0.245 seconds

Donate to Us

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