[ic] MAP Pricing and results_grid (SOLVED)
Lisa Collins
lisa at ultimatepassage.com
Thu May 17 10:53:10 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
Greg,
THANK YOU SO VERY MUCH! I couldn't have done that without your help!
And with this addition, it works Perfectly!...
if ($map_price > 0){
$record->{price} = <<EOF;
<span style="color: #000000; font-size:12px; font-weight: normal;">Add
to Cart<br>For Instant Price Quote</span>
EOF
}
else {
$record->{price} = $Tag->price($sku);
}
Thanks, Again!
Lisa
More information about the interchange-users
mailing list