Your Cart is currently empty!
Product update
Coupon
add
Coupon code invalid! Please re-enter!
AJAX loader
You are here: HomeForum
Welcome, Guest

Adding Base Price and You Save to module
(1 viewing) (1) Guest
User-guide, report bugs, new ideas, ...
  • Page:
  • 1

TOPIC: Adding Base Price and You Save to module

Adding Base Price and You Save to module 10 years, 12 months ago #9289

www.99cables.com
Using Style 1
Would like the price displayed:
  • Regular Price -- this is the base price
  • Sales Price
  • You Save---difference between regular and save price


this is the code in layout1.php
<?php if($options->item_show_price == 1){?>
<div class="item-price">
<?php
if ($item->prices['discountAmount'] > 0 ){
$price_before_discount = $item->prices['salesPrice'] + $item->prices['discountAmount']; ?>
<div class="sale-price-before"><?php echo $vm_currency_display->priceDisplay($price_before_discount); ?></div>
<?php
} ?>
<div class="sale-price"><?php echo $vm_currency_display->priceDisplay($item->prices['salesPrice']);?></div>
</div><!--end item-price-->
<?php }?>


these are the logic statements from virtuemart that id liek to have added to the layout1 file to display the pricing..


1.) echo this->currency->createPriceDiv('basePrice','COM_VIRTUEMART_PRODUCT_BASEPRICE',$product->prices);

2.)echo $this->currency->createPriceDiv('discountAmount', 'COM_VIRTUEMART_PRODUCT_DISCOUNT_AMOUNT', $product->prices);


please let me know
thanks

trey
Last Edit: 10 years, 12 months ago by treybraid.

Re: Adding Base Price and You Save to module 10 years, 12 months ago #9300

  • SA Thuy
Dear trey braid,

I see on your website, Regular Price, Sales Price and You Save are all displayed and work fine.

Please feel free to contact us if you need further information.

Thanks

Re: Adding Base Price and You Save to module 10 years, 12 months ago #9301

please take a look at the accordion module which is the one i'm asking about-- scroll down the page and let me know how i can add the virtuemart logic statements to the module.

please explain how to do this and ill add

thanks
trey

Re: Adding Base Price and You Save to module 10 years, 12 months ago #9318

  • SA Thuy
Dear trey braid,

Please open vmcategoriesaccordionreader.php(yoursite/modules/mod_sj_vm_categories_accordion/core/vmcategoriesaccordionreader.php) and find:

$query = "
				SELECT
					p1.virtuemart_product_id AS id,
					p1.product_name AS title,
					p1.product_s_desc AS description,
					p1.slug AS slug,
					p2.product_sku AS sku,
					p2.product_in_stock,
					p2.product_ordered,
					p2.product_sales,
					p2.created_on,
					price.product_price,
					price.product_currency,
					(
						SELECT m.file_url
						FROM #__virtuemart_medias m
						INNER JOIN #__virtuemart_product_medias pm ON pm.virtuemart_media_id=m.virtuemart_media_id
						WHERE pm.virtuemart_product_id=p2.virtuemart_product_id AND m.published=1
						ORDER BY pm.ordering
						LIMIT 0, 1
					) AS image,
					(SELECT COUNT(pr.virtuemart_rating_review_id) FROM #__virtuemart_rating_reviews pr WHERE pr.virtuemart_product_id=p2.virtuemart_product_id AND pr.published=1) AS reviews,
					GROUP_CONCAT(pcx.virtuemart_category_id) AS categories
				FROM #__virtuemart_products_$lang AS p1
					JOIN #__virtuemart_products AS p2 USING (virtuemart_product_id)
					LEFT JOIN #__virtuemart_product_prices AS price ON price.virtuemart_product_id=p1.virtuemart_product_id
					JOIN #__virtuemart_product_categories AS pcx ON pcx.virtuemart_product_id=p1.virtuemart_product_id
			  	WHERE
			  		p2.published=1
		$category_filter
		$source_filter
				GROUP BY p2.virtuemart_product_id
		$source_order_by
		$source_limit
			";

add "price.product_override_price":
$query = "
				SELECT
					p1.virtuemart_product_id AS id,
					p1.product_name AS title,
					p1.product_s_desc AS description,
					p1.slug AS slug,
					p2.product_sku AS sku,
					p2.product_in_stock,
					p2.product_ordered,
					p2.product_sales,
					p2.created_on,
					price.product_price,
					price.product_override_price,
					price.product_currency,
					(
						SELECT m.file_url
						FROM #__virtuemart_medias m
						INNER JOIN #__virtuemart_product_medias pm ON pm.virtuemart_media_id=m.virtuemart_media_id
						WHERE pm.virtuemart_product_id=p2.virtuemart_product_id AND m.published=1
						ORDER BY pm.ordering
						LIMIT 0, 1
					) AS image,
					(SELECT COUNT(pr.virtuemart_rating_review_id) FROM #__virtuemart_rating_reviews pr WHERE pr.virtuemart_product_id=p2.virtuemart_product_id AND pr.published=1) AS reviews,
					GROUP_CONCAT(pcx.virtuemart_category_id) AS categories
				FROM #__virtuemart_products_$lang AS p1
					JOIN #__virtuemart_products AS p2 USING (virtuemart_product_id)
					LEFT JOIN #__virtuemart_product_prices AS price ON price.virtuemart_product_id=p1.virtuemart_product_id
					JOIN #__virtuemart_product_categories AS pcx ON pcx.virtuemart_product_id=p1.virtuemart_product_id
			  	WHERE
			  		p2.published=1
		$category_filter
		$source_filter
				GROUP BY p2.virtuemart_product_id
		$source_order_by
		$source_limit
			";


Then:
Open file layout1.php(yoursite/modules/mod_sj_vm_categories_accordion/tmpl/layout1.php) find code:

<?php if($options->item_show_price == 1){?>
<div class="item-price">
<?php
if ($item->prices['discountAmount'] > 0 ){
$price_before_discount = $item->prices['salesPrice'] + $item->prices['discountAmount']; ?>
<div class="sale-price-before"><?php echo $vm_currency_display->priceDisplay($price_before_discount); ?></div>
<?php
} ?>
<div class="sale-price"><?php echo $vm_currency_display->priceDisplay($item->prices['salesPrice']);?></div>
</div><!--end item-price-->
<?php }?>

and edit:
<?php if($options->item_show_price == 1){?>
                                <div class="item-price">		
                                		
						<?php
						//var_dump($item);
						if ($item->product_override_price > 0 ){?>
						<div style="text-decoration: line-through !important; font-size: 14px; color: #003366;">Regular Price:<?php echo $vm_currency_display->priceDisplay($item->prices['salesPrice']);?></div>
						<div class="sale-price">Sales Price:<?php echo $vm_currency_display->priceDisplay($item->product_override_price);?></div>
							<?php $youSave = $item->prices['salesPrice'] - $item->product_override_price; ?>
							<div class="PricediscountAmount"><?php echo 'You Save: '.$vm_currency_display->priceDisplay($youSave); ?></div>
						<?php
						} else{?>
						<div class="sale-price">Regular Price:<?php echo $vm_currency_display->priceDisplay($item->prices['salesPrice']);?></div>
						<?php
						}?>
						
									
                                </div><!--end item-price-->
                            <?php }?>


P/S: I edited on your site, please check it again
Thanks
Last Edit: 10 years, 12 months ago by .
  • Page:
  • 1
Time to create page: 0.23 seconds

Notification

Please find your issue via Suggested Posts before submitting your question. We have solved the most of issues and maybe your issue was solved before.

Latest My Topics

No posts to display.

Love all our templates?

Join our membership clubs starting at $49 only for access to all of our templates

Join Now
Home Pricing
Your Cart is currently empty!
Product update
Coupon
add
Coupon code invalid! Please re-enter!
AJAX loader
SearchSupport
Magento Themes Magento Extensions Free Magento Extensions Prestashop Themes Prestashop Modules Magento 2 Themes