[ic] MAP Pricing and results_grid
Greg Hanson
greg at perusion.com
Wed May 16 18:02:32 EDT 2007
Lisa Collins wrote:
> Please forgive my total lack of Perl knowledge but I need to figure
> out how to change the results_grid.
>
> I have some products which require I show a MAP (Minimum Advertised
> Price) but once the buyer adds it to the shopping cart, it displays my
> Actual Selling Price. (it's stupid, but rules of certain manufacturers).
>
> I have a field named 'map_price' in my products.txt.
>
> On the results_grid, I am simply at a loss on how to do something like
> this, in perl:
>
> (this works flawlessly on my flypage)
>
> [if-item-field map_price]
> <td align="center">M.A.P. (Minimum Advertised
> Price): [item-field map_price]
> <br><b>Click "ADD TO CART" For<br>OUR SELLING PRICE!</b></td>
> [else]
> [item-calc]
> my $q = q{[item-field price]};
> if($q > 0) {
> return <<EOF;
> <td align="center"><big><b><font color="#ff0000">OUR
> PRICE:</font></b><b>[item-field price]
> -------------
>
> In the perl template results_grid, what do I need to add (I plead with
> you to be Specific. Pretty-please!) to show, "Add to Cart for Our
> Price" IF a map_price is present ELSE price??
>
> I've tried so many different things that my head is spinning.
>
> Blessings,
>
> Lisa
Lisa,
You might try the something like the following (untested) in your
component results_grid
[item-sub show_product]
my $sku = shift;
my $pdb = $Db{products};
my $record = $pdb->row_hash($sku);
return undef unless $record;
my $map_price = $record->{map_price}; # add this line
[snip to further down in the code]
<tr class="contentbar1"><td style="font-size:10px;">[L]Price[/L]:
{PRICE}</td><td align=right valign=middle>{QUANTITY_BOX}
{BUY_BUTTON}</td></tr>
</table>
</div>
EO_TMPL
##add these lines
if ($map_price > 0){
$record->{price} = $Tag->currency($map_price);
}
else {
$record->{price} = $Tag->price($sku);
}
Greg
>
>
>
>
>
>
>
>
>
> _______________________________________________
> interchange-users mailing list
> interchange-users at icdevgroup.org
> http://www.icdevgroup.org/mailman/listinfo/interchange-users
>
>
--
Greg Hanson
Interchange Consulting
Perusion
1506 E Gilbert Ave
Coeur d'Alene, ID 83815
Email greg at perusion.com
Phone 208-667-2442
Toll Free 800-949-1889
Fax 775-256-2231
Web http://www.perusion.com
More information about the interchange-users
mailing list