Welcome, Guest
Username: Password: Remember me
Use this Category for your support questions about Virtuemart Template - FlexibleMart (SKU# FLEX-00007)

TOPIC: Can't get "Call for Pricing to work

Can't get "Call for Pricing to work 7 years 9 months ago #8745

I have read the other topics on the site and I can not figure out why this is not working for me.

I have the feature turned on and these items have no price but still it does not work.

example
www.allisonenterprise.com/new/index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=263&virtuemart_category_id=70&Itemid=4

What am I missing

I am running
Joomla: 2.5.18
Virtuemart: 2.0.26d
Template: FlexibleMart 2.3
The administrator has disabled public write access.

Can't get "Call for Pricing to work 7 years 9 months ago #8754

Hi,

You are not missing anything, apparently we have missed it.

It is relatively easy to patch it and you can take care of it by yourself.

Open this PHP file:
/templates/YOUR_TEMPLATE/html/com_virtuemart/productdetails/default.php
default.php, flexv2.php or flexv3.php, depends on what layout you are using for product details page

Then find this line:
<?php // Add To Cart Button
         if (!VmConfig::get('use_as_catalog',0)) { 
           if (!empty($this->product->customfieldsSorted['ontop'])) {

(make sure to select these these lines, and replace those 3 lines with these below:
<?php // Add To Cart Button
      if ($this->product->prices['salesPrice']<=0 and VmConfig::get ('askprice', 1) and isset($this->product->images[0]) and !$this->product->images[0]->file_is_downloadable) {
      ?>
          <a class="ask-a-question" href="<?php echo JRoute::_('index.php?option=com_virtuemart&view=productdetails&task=askquestion&virtuemart_product_id='.$this->product->virtuemart_product_id.'&virtuemart_category_id='.$this->product->virtuemart_category_id); ?>"><?php echo JText::_('COM_VIRTUEMART_PRODUCT_ASKPRICE') ?></a>		
      <?php }
      if (!VmConfig::get('use_as_catalog', 0) and (!empty($this->product->prices['salesPrice']))) {
        if (!empty($this->product->customfieldsSorted['ontop'])) {

This coding changes will be generate the "Call for Price" button if the product price is empty.
If you still don't see that button, then check here:

Virtuemart Bacnekdn >> Configuration >> Pricing
and make sure this option is enabled: Show call for price, when the price is empty

-- If you are seeing "Login First" error message, when you click the "Call for Price" button; then you may want to enable this option:
Allow non logged-in to send a recommendation or ask a question from Virtuemart Bacnekdn >> Configuration >> Shopfront

Regards,
Support
Last Edit: 7 years 9 months ago by Support.
The administrator has disabled public write access.

Can't get "Call for Pricing to work 7 years 8 months ago #8776

Worked perfectly for the product page. Thank You very much
Also so you know the same issue seems to be on the flex2 category page and the code is a little different
<?php // Add To Cart Button
				if (!VmConfig::get('use_as_catalog',0)) { ?>
				<div class="addtocart-area">

I think we are going to choose a different layout but thought I would ask just in case
The administrator has disabled public write access.

Can't get "Call for Pricing to work 7 years 8 months ago #8793

Hi,

First of all; to hide the add to cart button (when the price field is empty)

replace this line:
<?php // Add To Cart Button
      if (!VmConfig::get('use_as_catalog',0)) { ?>

with this (for product details page):
<?php // Add To Cart Button
      if (!VmConfig::get('use_as_catalog', 0) and (!empty($this->product->prices['salesPrice']))) {

with this (for category browse page):
<?php // Add To Cart Button
      if (!VmConfig::get('use_as_catalog', 0) and (!empty($product->prices['salesPrice']))) {

Then, use the below codes to print the CALL FOR PRICE text/link in where ever you want to show it (call for price link will be visible only if the product price is empty for that specific product)

In the product details page:
<?php if ($this->product->prices['salesPrice']<=0) { ?>
Call 800-123-4567 or <a href="/contact">email us</a>  for price.
<?php } ?>

in the category browse page:
<?php if ($product->prices['salesPrice']<=0) { ?>
Call 800-123-4567 or <a href="/contact">email us</a>  for price.
<?php } ?>

No need to combine lots of conditions such as; VmConfig::get ('askprice', 1) and isset($this->product->images[0]) and !$this->product->images[0]->file_is_downloadable) and !VmConfig::get('use_as_catalog',0) etc.. Those are for very rare situations. I don't think you will even need those extra conditions. Checking the price field would be enough for you.

FYI: When you look at the conditions, they make sense though: For example;
- VmConfig::get ('askprice', 1): Checks if you enabled the "Show call for price, when the price is empty" parameter
- VmConfig::get('use_as_catalog',0) checks if your Virtuemart is in "Catalog" mode or not.
- $this->product->images[0]->file_is_downloadable checks if that particular product is downloadable content or not.

Regards,
Support
Last Edit: 7 years 8 months ago by Support.
The administrator has disabled public write access.
Time to create page: 0.466 seconds

MaterialMart

for Virtuemart 3

Google's Material Design has finally arrived to Virtuemart

Virtumart Template - MaterialMart Virtumart Template - CleanMart Virtumart Template - CleanMart Virtumart Template - CleanMart

Fully responsive!

Buy Now   |   Live Demo