Item aditional info in Datafeed for Joomla 3.x

More
8 years 11 months ago #3309 by dalens
Hello,
Please, how can I add the items' aditional info like size, color, old price in Datafeed for Joomla 3.x
There is this option in Datafeed for Joomla 2.5, but not 3.x
Thank you in advance!

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

More
8 years 11 months ago #3311 by bram
You mean the bullet list you could add to the description?

That one has been removed. It's way more flexible to customize the template, although it needs a bit more work

For example map the color field from the feed to the database field Select16

Now customze for example default_full.php

Code:
$color=$item['Select16']; if ( $color) { echo '<p class="color">The color is : '. $color.'</p>'; }

Or create a lu/lilist.


old price to Select17

Code:
$old_price=$item['Select17']; if ( $old_price && ( $old_price>$product_price ) ) { print '<p class="sale"><span>'.$currency.' '.money_format('%!.2n', $old_price).'</span></p>'; }

or recalculate it to a discount amount:


Attachments:
The following user(s) said Thank You: dalens

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

More
8 years 11 months ago #3314 by dalens
Hi Bram,
Yes, I mean the bullet list I could add to the item's description.
I have tried to add these pieces of script to default_full.php, but without any success...
Please, would you write a full script for default_full.php

I need these fields in description:
  • Size
  • Color
  • Old price with % reduction
  • Merchantcategory
Thank you!

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

More
8 years 11 months ago - 8 years 11 months ago #3327 by bram
First step is to map the fields from the feed to the database in the feed configuration:




update/import the feeds!


Then add code to your template:
Code:
echo '<div class="prijs">&euro;'.$product_price.'</div>'; @$x=$item['Select6']; if ($x > $item['Prijs']) { print '<h2>Aanbieding</h2><div class="prijs sale">oude prijs: ' . money_format('%!.2n', $x).'</div>'; } $list=array(); if ( @$item['Select4'] ) { $list[]='Merk : ' . $item['Select4']; } if ( @$item['Select5'] ) { $list[]='Kleur : ' . $item['Select5']; } if ( @$item['Select8'] ) { $list[]='Model : ' . $item['Select8']; } if ( @$item['Select7'] ) { $list[]='Materiaal : ' . $item['Select7']; } if ( count($list) ) { echo '<ul class="product"><li>'.join('</li><li>',$list).'</li></ul>'; }

and some CSS as you like.

result:




You can create your own description like:
Code:
$description=''; if ( @$item['Select8'] ) { $description.='Dit is een ' . strtolower($item['Select8']); } if ( @$item['Select4'] ) { $description.=' van het merk <strong>' . $item['Select4']."</strong>"; } if ( @$item['Select5'] ) { $description.=' in de kleur ' . strtolower($item['Select5']); } if ( @$item['Select7'] ) { $description.=' en gemaakt van : ' . strtolower($item['Select7']); } if ( $description ) { echo '<p class="des">'.$description.'</p>'; }



demo :

demos.affiliatefeeds.nl/shop/kleding.html


In the default_full template the place to add the code above would be near:
Code:
echo $item['description']; if ( $product_price > 0 ) { print '<p class="prijs"><span>'.$currency.' '.money_format('%!.2n', $product_price).'</span></p>'; }
Attachments:
Last edit: 8 years 11 months ago by bram.
The following user(s) said Thank You: dalens

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

More
8 years 11 months ago #3329 by dalens
Thank you very much!
Please, how to get this piece of code to look like a list:
$description='';
if ( @$item ) { $description.='Dit is een ' . strtolower($item); }
if ( @$item ) { $description.=' van het merk <strong>' . $item."</strong>"; }
if ( @$item ) { $description.=' in de kleur ' . strtolower($item); }
if ( @$item ) { $description.=' en gemaakt van : ' . strtolower($item); }
if ( $description ) {
echo '<p class="des">'.$description.'</p>';
}

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

More
8 years 11 months ago #3330 by bram

dalens wrote: Thank you very much!
Please, how to get this piece of code to look like a list:


See the first example code

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

Time to create page: 0.309 seconds