News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

HTML Price display

Started by J3DI13, December 02, 2013, 08:35:44 AM

Previous topic - Next topic

J3DI13

Hello people

I am running J2.5 and VM2.0.24c

I am trying to get the http://dynamicconverter.com/ work, i contacted the support and they said:

QuoteDynamic converter needs to see the currency symbol next to the digits to associate the digits as currency.
>
> Your currency symbol is the letter R, and I see that you have added that as the special currency symbol, Awesome.
>
> However here is the issue: Your price html block looks like this <div
> style="display : block;" class="PricebasePrice">Base price: <span
> class="PricebasePrice"><span class="caps">R<span
> class="numbers">201</span></span>.<span
> class="numbers">99</span></span></div>
>
> So in essence DC detect 201 but cant see the R so ignores that then it
> detects 99 and again can't see the R symbol. So effectively your
> prices are like
> | R | 201 | . | 99 |  where | represents a separate block that dc scans.
>
> Solution:
> You need to move the prices in together like so | R 201.99 | This means DC would detect 201.99 and since it can see R next to it, it will assume this number as a currency value.
>
> So the Html needs to be like
> <div style="display : block;" class="PricebasePrice">Base price: <span
> class="PricebasePrice"> R 201.99</span></div>

Now my question is how do i change it?

J3DI13


GJC Web Design

Totally depends where and how your producing your

<div> style="display : block;" class="PricebasePrice">Base price:
<span > class="PricebasePrice"><span class="caps">R<span> class="numbers">201</span></span>.<span> class="numbers">99</span></span></div>


P:S the html from the paste is simply wrong
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

J3DI13

i have checked the VM files com_virtuemart/views/cart/tmpl/default.php and can find some references to the PricebasePrice but cannot for the life of me find that HTML.

GJC Web Design

You still haven't explained where you are producing or needing or seeing this html ??? How can anyone help with this complete lack of info?

all prices are available in the templates

echo out the $product object

e.g. in components/com_virtuemart/views/productdetails/tmpl/default_showprices.php

print 'Debug Line '.__LINE__.' $this->product->prices <pre>'; print_r ($this->product->prices); print "</pre><br />\n";

gives

Debug Line 20 $this->product->prices

Array
(
    [costPrice] => 100.00000
    [basePrice] => 16.16458322
    [basePriceVariant] => 16.16458322
    [basePriceWithTax] => 0
    [discountedPriceWithoutTax] => 16.16458322
    [priceBeforeTax] => 16.16458322
    [salesPrice] => 16.16458322
    [taxAmount] => 0
    [salesPriceWithDiscount] => 0
    [salesPriceTemp] => 16.16458322
    [unitPrice] => 0
    [discountAmount] => -0
    [priceWithoutTax] => 16.16458322
    [variantModification] => 0
    [DBTax] => Array
        (
        )

    [Tax] => Array
        (
        )

    [VatTax] => Array
        (
        )

    [DATax] => Array
        (
        )

)



GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

J3DI13

HI GJC

It is being produced on all the product prices through out the shop.
I basically want the converter to convert the currency when the user selects it from the drop down, without the user having to select the change currency button.
The native VM converter module doesn't do that so i found an alternative but now this issue is stopping it from working.

The shop is not 'live' but is behind a link that admin can access, i am willing to give login info if that might help?

Thanks

GJC Web Design

just create your own price div.. and dump all the stuff already there

something like

<div id="PricebasePrice" >Price : R <?php echo number_format($this->product->prices['salesPrice'],2,',','.'?></div>

in templates/YOURTEMPLATEt/html/com_virtuemart/productdetails/default_showprices.php 
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

J3DI13

Are you saying that i must delete the current Div tag in default_showprices.php
<div class="product-price" id="productPrice<?php echo $this->product->virtuemart_product_id ?>">

and replace with what you posted below
Quote<div id="PricebasePrice" >Price : R <?php echo number_format($this->product->prices['salesPrice'],2,',','.') ?></div>

Sorry to be a pain like this i just want to make sure i am doing the correct thing.

Thanks

GJC Web Design

just suck and see - your code isn't original vm so I have no way of knowing
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

J3DI13

How is it not original VM code, i havent touched that file at all?
I will give it a bash and see.
Thanks

GJC Web Design

the original is

defined ('_JEXEC') or die('Restricted access');
?>
<div class="product-price" id="productPrice<?php echo $this->product->virtuemart_product_id ?>">
<?php
if (!empty(
$this->product->prices['salesPrice'])) {
echo "<strong>" JText::('COM_VIRTUEMART_CART_PRICE') . "</strong>";
}
//vmdebug('view productdetails layout default show prices, prices',$this->product);
if ($this->product->prices['salesPrice']<=and VmConfig::get ('askprice'1) and isset($this->product->images[0]) and !$this->product->images[0]->file_is_downloadable) {
?>

<a class="ask-a-question bold" href="<?php echo $this->askquestion_url ?>" rel="nofollow" ><?php echo JText::('COM_VIRTUEMART_PRODUCT_ASKPRICE'?></a>
<?php
} else {
if ($this->showBasePrice) {
echo $this->currency->createPriceDiv ('basePrice''COM_VIRTUEMART_PRODUCT_BASEPRICE'$this->product->prices);
if (round($this->product->prices['basePrice'],$this->currency->_priceConfig['basePriceVariant'][1]) != $this->product->prices['basePriceVariant']) {
echo $this->currency->createPriceDiv ('basePriceVariant''COM_VIRTUEMART_PRODUCT_BASEPRICE_VARIANT'$this->product->prices);
}

}
echo $this->currency->createPriceDiv ('variantModification''COM_VIRTUEMART_PRODUCT_VARIANT_MOD'$this->product->prices);
if (round($this->product->prices['basePriceWithTax'],$this->currency->_priceConfig['salesPrice'][1]) != $this->product->prices['salesPrice']) {
echo '<span class="price-crossed" >' $this->currency->createPriceDiv ('basePriceWithTax''COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX'$this->product->prices) . "</span>";
}
if (round($this->product->prices['salesPriceWithDiscount'],$this->currency->_priceConfig['salesPrice'][1]) != $this->product->prices['salesPrice']) {
echo $this->currency->createPriceDiv ('salesPriceWithDiscount''COM_VIRTUEMART_PRODUCT_SALESPRICE_WITH_DISCOUNT'$this->product->prices);
}
echo $this->currency->createPriceDiv ('salesPrice''COM_VIRTUEMART_PRODUCT_SALESPRICE'$this->product->prices);
if ($this->product->prices['discountedPriceWithoutTax'] != $this->product->prices['priceWithoutTax']) {
echo $this->currency->createPriceDiv ('discountedPriceWithoutTax''COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX'$this->product->prices);
} else {
echo $this->currency->createPriceDiv ('priceWithoutTax''COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX'$this->product->prices);
}
echo $this->currency->createPriceDiv ('discountAmount''COM_VIRTUEMART_PRODUCT_DISCOUNT_AMOUNT'$this->product->prices);
echo $this->currency->createPriceDiv ('taxAmount''COM_VIRTUEMART_PRODUCT_TAX_AMOUNT'$this->product->prices);
$unitPriceDescription JText::sprintf ('COM_VIRTUEMART_PRODUCT_UNITPRICE'JText::_('COM_VIRTUEMART_UNIT_SYMBOL_'.$this->product->product_unit));
echo $this->currency->createPriceDiv ('unitPrice'$unitPriceDescription$this->product->prices);
}
?>

</div>


stick

<div id="PricebasePrice" >Price : R <?php echo number_format($this->product->prices['salesPrice'],2,',','.') ?></div>

at the bottom to see if thats what u want
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

J3DI13

Hi GJC

After reading my last post again, i come off a bit blunt and for that i apologise.

Thank you for your last response, going to try it now.

cheers

J3DI13

So i pasted the code at the bottom of the default_showprices.php and no luck. Im starting to think i must look for yet another alternative...

GJC Web Design

if you paste the snippet directly berore the

<div class="product-price" id="productPrice<?php echo $this->product->virtuemart_product_id ?>">

it will definitely render

R 20,00  etc

there is now reason why it wouldn't

the html will be

<div id="PricebasePrice" >Price : R 20,00</div>



GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

J3DI13

Hi GJC

Its still not working, I have attached the file for you view.
If i cannot get it working by today then i give up lol.

Thanks

[attachment cleanup by admin]