News:

Looking for documentation? Take a look on our wiki

Main Menu

syntax change vm 1.1 - vm 3 breaking form

Started by dsrpmedia, February 03, 2015, 23:11:11 PM

Previous topic - Next topic

dsrpmedia

Hi

I have an old joomla1.5.x / vm 1.1.x site I am upgrading to Joomla 3.3.6  / vm 3.0.2

In the original site I use virtuemart for everything but the actual payment processing - on my product details page I have a form which loads the payment processor with the details of the product being purchased

  <form action="http://processing-site.com" method="post" name="form1" target="_self">
<input name="userid" type="hidden" value="member-id" />
    <input name="product" type="hidden" value="<?php echo $product_sku ?> <?php echo $product_name ?>" />
    <input name="price" type="hidden" value="<?php echo $product_price ?>" />
    <input name="qty" type="hidden" value="1" />
   <input name="return" type="hidden" value="mysite.com<?php echo $previous ?>" />

   
    <input name="Submit2" type="submit" value="Buy Now" />
    </form>


which has worked fine for years.

when i load this code onto the vm 3.0.2 product details page, the 'buy now' appears & when clicked go to the processor page, but the product name and price do not load.

I noticed that the syntax for calling eg the products` price has changed from <?php echo $product_price ?> to <?php echo $this->product->$product_price ?>

however when I enter this into the value eg <form action="http://processing-site.com" method="post" name="form1" target="_self">
<input name="userid" type="hidden" value="member-id" />
    <input name="product" type="hidden" value="<?php echo $this->product->$product_sku ?>   <?php echo $this->product->$product_name ?>" />
    <input name="price" type="hidden" value="<?php echo $this->product->$product_price ?>" />
    <input name="qty" type="hidden" value="1" />
   <input name="return" type="hidden" value="mysite.com<?php echo $previous ?>" />

   
    <input name="Submit2" type="submit" value="Buy Now" />
    </form>


the product details template loses all its` styling and the 'buy now' button does not appear at all

any suggestions on how I can tweak the new syntax so it works like the old syntax would be greatly appreciated

thank you!

GJC Web Design

it isn't for example   :  $this->product->$product_sku

it is $this->product->product_sku
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

dsrpmedia

awesome - I`m 1/2 way there - the sku (product_sku) & product name (>product_name) are now loading - but the price is not

I am using <?php echo $this->product->product_price ?>

is there a different syntax for the price now?

GJC Web Design

prices are an array now

Array
(
    [virtuemart_product_price_id] => 1
    [virtuemart_product_id] => 1
    [virtuemart_shoppergroup_id] => 0
    [product_price] => 10.000000
    [override] => 0
    [product_override_price] => 0.00000
    [product_tax_id] => -1
    [product_discount_id] => -1
    [product_currency] => 47
    [product_price_publish_up] => 0000-00-00 00:00:00
    [product_price_publish_down] => 0000-00-00 00:00:00
    [price_quantity_start] => 0
    [price_quantity_end] => 0
    [created_on] => 2015-01-30 18:30:06
    [created_by] => 750
    [modified_on] => 2015-01-30 18:55:58
    [modified_by] => 750
    [locked_on] => 0000-00-00 00:00:00
    [locked_by] => 0
    [costPrice] => 10
    [basePrice] => 10
    [basePriceVariant] => 10
    [basePriceWithTax] => 0
    [discountedPriceWithoutTax] => 10
    [priceBeforeTax] => 10
    [salesPrice] => 10
    [taxAmount] => 0
    [salesPriceWithDiscount] => 0
    [salesPriceTemp] => 10
    [unitPrice] => 0
    [discountAmount] => 0
    [priceWithoutTax] => 10
    [variantModification] => 0
    [DBTax] => Array
        (
        )

    [Tax] => Array
        (
        )

    [VatTax] => Array
        (
        )

    [DATax] => Array
        (
        )

    [shipmentPrice] => 0
)



e.g.

$this->product->prices['salesPrice']
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

dsrpmedia

#4
thank you so much for taking the time to help me - I got it to work (I had an extra '$this->' )once I figured that out I`m back in business - thank you again!