Children categories
K2 CCK - Blog (3)
Tutorials relating the the CCK - Content Construction Kit K2, which we tend to install on most of our websites
View items...Virtuemart "PayPal (new API)" is causing "Credit Card" payment option to appear for no reason.
Written by AdministratorThis has been copied from www.aglobalweb.com so I can refer back to myself in future.
Problem
The introduction of new payment method "PayPal (new API)" is causing "Credit Card" payment option to appear for no reason.
Solution
To completely get rid of this problem, there are 3 files involved
- administrator/components/com_virtuemart/classes/ps_checkout.php -> method list_payment_methods()
- administrator/components/com_virtuemart/classes/ps_payment_method.php -> method list_payment_radio()
- components/com_virtuemart/themes/default/templates/checkout/get_payment_method_paypal_ex.tpl.php
administrator/components/com_virtuemart/classes/ps_checkout.php around line 830
Paypal (new API) are implemented separately from generic Virtuemart payment methods. So we need to prevent it from reloading again
function list_payment_methods( $payment_method_id=0 ) {
...
$db_nocc = new ps_DB;
$q = "SELECT * from #__{vm}_payment_method,#__{vm}_shopper_group WHERE ";
$q .= "#__{vm}_payment_method.shopper_group_id=#__{vm}_shopper_group.shopper_group_id ";
$q .= "AND (#__{vm}_payment_method.shopper_group_id='".$auth['shopper_group_id']."' ";
$q .= "OR #__{vm}_shopper_group.default='1') ";
$q .= "AND (enable_processor='B' OR enable_processor='N' OR enable_processor='P' AND `payment_class`!='ps_paypal_api') ";
$q .= "AND payment_enabled='Y' ";
$q .= "AND #__{vm}_payment_method.vendor_id='$ps_vendor_id' ";
$q .= " ORDER BY list_order";
...
}
administrator/components/com_virtuemart/classes/ps_payment_method.php Line 394-397
Paypal (new API) are implemented separately from generic Virtuemart payment methods. So we need to prevent it from reloading again
function list_payment_radio($selector, $payment_method_id, $horiz) {
...
$q = "SELECT payment_method_id,payment_method_discount, payment_method_discount_is_percent, payment_method_name from #__{vm}_payment_method WHERE ";
$q .= "(enable_processor='$selector' AND `payment_class`!='ps_paypal_api') AND ";
$q .= "payment_enabled='Y' AND ";
$q .= "vendor_id='$ps_vendor_id' AND ";
...
}
components/com_virtuemart/themes/default/templates/checkout/get_payment_method_paypal_ex.tpl.php Line 74-86
If you only use one payment method "Paypal (new API)", you need that payment method to be selected by default.
<fieldset><legend><strong>PayPal</strong></legend><table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr>
<td style="vertical-align:middle;">
<input type="hidden" id="paypalExpress_ecm" name="payment_method_ppex" value="" />
<input type="radio" id="paypalExpressID_ecm" name="payment_method_id" value="<?php echo ps_paypal_api::getPaymentMethodId();?>" checked="true" />
</td>
<td>
<?php echo $html; ?>
</td>
</tr>
</table>
</fieldset>
How to alter settings for front end editing screen in K2
Written by Administrator- In this tutorial we will be adding a new product to our shopping cart. This assumes you have already logged into your website and are at the Virtuemart Administrator page
- Navigate to Products >> Add Product
- Enter a SKU
- Enter a name for the product
- Select a category for your product - For multiple catagories hold down ctrl (PC) or cmd (mac)
- Enter a price for your product
- If you have a tax value, the total including tax will be calculated for you
- You can enter a discounted price if you like
- Enter a short description for your product. This will be displayed when people are viewing the category your product is in
- Enter a description for your product. This will be displayed when people are viewing the product
- Let's move on to the Product Status tab
- Enter the number of this item you have in stock
- Enter the availability on the product. This can be anything you want
- If you have any attributes for the product, list them here
- If you have any custom attributes add those here. This would be useful for an engraved message or name
- Let's move on to Product Dimensions and Weight
- Enter the information for your product
- If you have a downloadable product you can set that information here
- Let's move on to the Product Images tab
- Browse to upload your image
- VirtueMart can auto-create a thumbnail for you. Or you can upload one yourself
- Let's move on to the Related Products tab
- You can set other products to be shown on the product page. This is a great way to upsell visitors to your site
- Save the product
- Let's go check what the product looks like on the frontend
- This tutorial assumes you are logged into your website and at the Virtuemart Admin screen either by the backend or frontend of your website
- Navigate to Manufacturer >> Add Manufacturer Category
- Enter a name and description for the category
- Save the category
- Your new category has been created
Next to add the Manufacturer;
- Navigate to Manufacturer >> Add Manufacturer
- Enter the manufacturers name
- Enter their website - if required, though this could drive users away from your site to the manufacturers website
- You can select a category for them
- And enter an email address for them - if required, though this could drive users away from your site by emailing the manufacturer direct
- Save the manufacturer
- Your new manufacturer has been created