LemonStand Forum: Sale price? - LemonStand Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Sale price?

#1 User is offline   Dominic 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 63
  • Joined: 24-January 12

Posted 25 January 2012 - 01:47 PM

Product 1 is usually £9.99. For today I want it to be £8.99. On the front end I want to display:

Was: £9.99
Now: £8.99

I can't do this from the product edit screen. From what I've seen I have to create separate entries for each product in the Discount section of the Lemonstand? But I've got hundreds of products! I want to tick a box and punch in a number!

How are people doing this?
0

#2 User is offline   Hexarobi 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 103
  • Joined: 10-August 11

Posted 25 January 2012 - 02:00 PM

Set up a Catalog Price Rule for 1 pound off all products, or all products from manufacturer X, or all products in category Y, etc...
0

#3 User is offline   Manca 

  • Developer
  • Group: +Administrators
  • Posts: 114
  • Joined: 02-September 11

Posted 25 January 2012 - 02:28 PM

dardub made a custom module that adds a sale price field to the product. Have a look here, you may find it of some use. That's if you want to specify a set sale price for individual products. To apply a sale across multiple product, catalog price rules work best.

Thank you

#4 User is offline   Dominic 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 63
  • Joined: 24-January 12

Posted 28 January 2012 - 09:25 AM

This module works exactly as expected. However, I'm wondering what happens when you start adding catalog price rules and discounts. I'm assuming these functions will be completely unaware of the x_sale_price field, and will instead use the price field?
0

#5 User is offline   apepp 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 233
  • Joined: 30-October 11

Posted 28 January 2012 - 02:42 PM

View PostDominic, on 28 January 2012 - 09:25 AM, said:

This module works exactly as expected. However, I'm wondering what happens when you start adding catalog price rules and discounts. I'm assuming these functions will be completely unaware of the x_sale_price field, and will instead use the price field?


...i'm pretty sure you can set a catalog price rule for one product, or multiple products, and by a fixed amount...and apply coded rules with if or else statements:

<?
if (isset($paginate) && $paginate)
{
$page_index = isset($page_index) ? $page_index-1 : 0;
$records_per_page = isset($records_per_page) ? $records_per_page : 3;
$pagination = $products->paginate($page_index, $records_per_page);
}
else
$pagination = null;
?>



<? if ($pagination): ?>
<div class="view_controls">
<? $this->render_partial('pagination', array('pagination'=>$pagination, 'base_url'=>$pagination_base_url)); ?>
</div>
<? endif ?>


<ul id="products_list" class="grid">
<?
$products = $products instanceof Db_ActiveRecord ? $products->find_all() : $products;
foreach ($products as $product):
$is_discounted = $product->is_discounted();
$image_url = $product->image_url(0, 150, '150');
?>
<li>

<div class="product_image">
<? if ($image_url): ?>
<? if ($product->is_discounted()):  ?>
<div class="shake"><span title="<?= h($product->name) ?> ON SALE!" class="on_sale">On sale!</span></div>
<? endif ?>
<a href="<?= $product->page_url('product') ?>" title="<?= h($product->name) ?>"><img src="<?= $image_url ?>" alt="<?= h($product->name) ?>"/></a>
<? endif  ?>
</div>



<div class="product_info_list">
        
<h4><a title="<?= h($product->name) ?>" href="<?= $product->page_url('product') ?>"><?= h($product->name) ?></a></h4>



<? $grouped_products = $product->list_grouped_products();
  $min_price = null;
  $max_price = null;
  foreach ($grouped_products as $grouped_product)
  {
    $price = $grouped_product->get_discounted_price();
    if ($price < $min_price || $min_price === null)
       $min_price = $price;

    if ($price > $max_price || $max_price === null)
     $max_price = $price;
  }

  $this_product_price = $product->get_discounted_price(); // it is better to use this method instead of price(), because it reflects current catalog-level discounts ?>
  
  

<? if (count($grouped_products) > 1 && ($min_price != $this_product_price || $max_price != $this_product_price)): ?>

<span class="product_price"><?= format_currency($min_price) ?> – <?= format_currency($max_price) ?> <?= tax_incl_label() ?></span>

<? else: ?>

<? if ($product->is_discounted()):  ?>  
<span class="original_price">
 Original Price: <?= format_currency($product->price()) ?> <?= tax_incl_label() ?>
</span>
<br>
<? if ($is_discounted): ?>
<span class="sale_price">
Sale Price: <?= format_currency($product->get_discounted_price(1)) ?> <?= tax_incl_label() ?>
</span>
<? endif ?>

<? else: ?>
<span class="product_price"><?= format_currency($product->get_discounted_price()) ?> <?= tax_incl_label() ?></span>
<? endif ?>

<? endif ?>








<?= open_form() ?>



<p class="qty_controls">          
<label for="product_cart_quantity">Quantity          
<input title="Input quantity" class="quantity" name="grouped_product_cart_quantity[<?= $product->id ?>]" type="text" value="1" />
</label>    
</p>



<p>
<a href="#" class="button_control" title="ADD TO CART" onclick="return $(this).getForm().sendRequest(
'add_to_cart_ext',
{
extraFields: {
'product_id': '<?= $product->id ?>'
},
onSuccess: function(){
custom_alert('Success!!! - Your cart has been updated');
},
update: {'mini_cart_id': 'shop_mini_cart'}
});"><img title="ADD TO CART" class="btn_add_to_cart" alt="ADD TO CART" src="<?= theme_resource_url('images/btn_add_to_cart.gif') ?>"></a>
</p>



<p>
<a href="#" class="button_control" title="ADD TO COMPARE" onclick="return $(this).getForm().sendRequest(
'shop:on_addToCompare',
{
onSuccess: function(){
custom_alert('Product added to your compare list');
},
extraFields: {
'product_id': '<?= $product->id ?>'
},
update: {'compare_list_id': 'shop_compare_list'}
});">
<img title="ADD TO COMPARE" class="btn_add_to_compare" alt="ADD TO COMPARE" src="<?= theme_resource_url('images/btn_add_to_compare.gif') ?>"></a>
</p>



<input type="hidden" name="product_id" value="<?= $product->id ?>"/>
<input type="hidden" name="no_flash" value="1"/>
</form>

        
        
<p><?= h($product->short_description) ?></p>
<? if ($product->rating_all):  ?>
<p class="rating_info clearfix">
<span class="rating_<?= $product->rating_all*10 ?>">based on <?= $product->rating_all_review_num ?> reviews</span>
</p>
<? endif ?>



<p><a href="<?= $product->page_url('product') ?>" class="read_more_link" title="More details for <?= h($product->name) ?>">More details…</a></p>



</div>



</li>  
<? endforeach ?>
</ul>

0

#6 User is online   Aleksey 

  • Co-Founder
  • Group: +Administrators
  • Posts: 3,633
  • Joined: 31-October 09

Posted 29 January 2012 - 02:40 PM

Guys, FYI we are going to add the On Sale checkbox and Sale Price field to the product configuration form within 1 or 2 weeks.

Thank you

#7 User is offline   fullphat 

  • Member
  • Group: Members
  • Posts: 17
  • Joined: 17-January 12

Posted 30 January 2012 - 02:14 AM

AWESOME news Aleksey!
0

#8 User is online   Aleksey 

  • Co-Founder
  • Group: +Administrators
  • Posts: 3,633
  • Joined: 31-October 09

Posted 01 February 2012 - 07:23 PM

Hi guys,

We just published the On Sale checkbox and Sale Price or Discount field. Please update your installations.

Thank you

#9 User is offline   Dominic 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 63
  • Joined: 24-January 12

Posted 05 February 2012 - 07:33 PM

Perfect, thanks!
0

Share this topic:


Page 1 of 1

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users