Thursday, August 02, 2012

TOP 10 Solutions to common VirtueMart problems

1 The State field is disappearing on the customer registration form (and elsewhere)?

This is a javasript error caused by a rogue apostrophe in the jos_vm_state database table.
This is easy to correct using phpMyAdmin. Navigate to the jos_vm_state database table and click on the [EXPORT] tab. Export and save the table as a SQL file and open it in a text editor.
Now click on the [EMPTY] tab and delete all entries in the table (don't worry you have a full backup with the file you just exported).
Now just quickly scroll through the file and remove any apostrophes (') you find in the state names, and save the file.
In phpMyAdmin click on the [IMPORT] tab and select the file you just saved.

2 Add to cart button isn't working (nothing happens when it is clicked)?

Chances are that something is actually happening, but not noticably. We have found the most common reason is that there is a SEF component which is interfering with the AJAX content.
An easy solution that works most of the time is to turn off the Use Ajax to add, update or delete products from the cart?.
Go to VirtueMart > Configuration > Site TAB > Layout > Configuration > Use Ajax to add, update or delete products from the cart? > No

3 I want the custom attributes to be optional (for personalization of products) or to adjust the product price?

For this you will need to install a hack found in the ViruteMart forums.
Here's a link to the forum; http://forum.virtuemart.net/index.php?topic=39666.0

4 I need a better product reporting system from my VirtueMart component?

This is a third-party product which we highly recommend. It does cost a little but the ease of use and the fact you can use it on all of your sites make this a must have.
This component (or addon) is found at; http://www.interamind.com/index.php?option=com_content&view=article&id=64&Itemid=71

5 My theme.css file isn't being loaded or my add to cart graphics are not being displayed?

This sometimes happens because there is a serious javascript conflict occuring and generally is cause for a full reinstall, however occasionally this can be quickly fixed by checking your Site URL settings.
To check the settings go to VirtueMart > Configuration > Site > Security > Site URL and Secure URL.

6 Get clean, search engine friendly URLs for free

There are some commercial add-ons, however there is a terrific free solution which not only fixes your VirtueMart URLs but your entire site as well.
Here's a link to the component sh404sef; http://extensions.joomla.org/extensions/10134
A couple notes when configuring for your VirtueMart store.
  1. Make sure you are in Advanced mode by clicking the link in the top left of the component main page (in the blue information area).
  2. In Configuration > Plugins > Virtuemart Configuration, be sure to switch the Using items per page drop-down list if you have over 20 products in a category.
  3. Make sure you add in a Insert category ID in URL if you have similar categories (this one tripped us up for a jewelry store we made which had a gemstone sub-category in both rings and necklaces parent categories).
  4. For better SEF results navigate to the Meta/SEO tab and add in some keyword text in the Append to page title input box.

7 I changed my flypage/ category browse page and nothing changed?

First double-check the settings for the individual category settings under VirtueMart > Products > List Categories > Flypage/ Category Browse page settings.
If that doesn't work, chances are that your SEF component has saved the old settings in its' URL rewrite rules. Simply re-cache your URLs in your SEF component and your pages should be updated.

8 My customers are having problems completing their orders through Paypal, it is saying that their country is not allowed?

This is a simple to fix error, essentially the way that the default code passes the order data to Paypal generates this error. Copy and replace the code in VirtueMart > List Payment Methods > Paypal with the code below:
<?php $db1 = new ps_DB(); $q = "SELECT country_2_code FROM jos_vm_country WHERE country_3_code='".$user->country."' ORDER BY country_2_code ASC"; $db1->query($q); $url = "https://www.paypal.com/cgi-bin/webscr"; $tax_total = $db->f("order_tax") + $db->f("order_shipping_tax"); $discount_total = $db->f("coupon_discount") + $db->f("order_discount"); $post_variables = Array( "cmd" => "_ext-enter", "redirect_cmd" => "_xclick", "upload" => "1", "business" => PAYPAL_EMAIL, "receiver_email" => PAYPAL_EMAIL, "item_name" => $VM_LANG->_('PHPSHOP_ORDER_PRINT_PO_NUMBER').": ". $db->f("order_id"), "order_id" => $db->f("order_id"), "invoice" => $db->f("order_number"), "amount" => round( $db->f("order_subtotal")+$tax_total-$discount_total, 2), "shipping" => sprintf("%.2f", $db->f("order_shipping")), "currency_code" => $_SESSION['vendor_currency'], "address_override" => "0", "first_name" => $dbbt->f('first_name'), "last_name" => $dbbt->f('last_name'), "address1" => $dbbt->f('address_1'), "address2" => $dbbt->f('address_2'), "zip" => $dbbt->f('zip'), "city" => $dbbt->f('city'), "state" => $dbbt->f('state'), "country" => $db1->f('country_2_code'), "email" => $dbbt->f('user_email'), "night_phone_b" => $dbbt->f('phone_1'), "cpp_header_image" => $vendor_image_url, "return" => SECUREURL ."index.php?option=com_virtuemart&page=checkout.result&order_id=".$db->f("order_id"), "notify_url" => SECUREURL ."administrator/components/com_virtuemart/notify.php", "cancel_return" => SECUREURL ."index.php", "undefined_quantity" => "0", "test_ipn" => PAYPAL_DEBUG, "pal" => "NRUBJXESJTY24", "no_shipping" => "1", "no_note" => "1" ); if( $page == "checkout.thankyou" ) { $query_string = "?"; foreach( $post_variables as $name => $value ) { $query_string .= $name. "=" . urlencode($value) ."&"; } vmRedirect( $url . $query_string ); } else { echo '<form action="'.$url.'" method="post" target="_blank">'; echo '<input type="image" name="submit" src="https://www.paypal.com/en_US/i/btn/x-click-but6.gif" border="0" alt="Click to pay with PayPal - it is fast, free and secure!" />'; foreach( $post_variables as $name => $value ) { echo '<input type="hidden" name="'.$name.'" value="'.htmlspecialchars($value).'" />'; } echo '</form>'; } ?>

9 How can use Google Analytics Ecommerce conversion tracking features with VirtueMart?

Luckily this is very easy and there are two free modules that you can use to get it up and working:

10 I'm having problems properly resizing my additional product images?

Although when you upload additional product images you have the option to resize the thumbnail in the dialog, it is highly recommended that you first change the default image thumbnail values defined in VirtueMart > Configuration > Site > Thumbnail Image Width/ Height.
By changing these values to the size that you want your additional product images to be displayed at you will be able to fix most layout problems.
Also make sure that the Enable Dynamic Thumbnail Resizing is also checked.
Finally if this does work use your FTP client and download your thumbnail images /components/com_virtuemart/shop_image/resized/, manually resize the images and re-upload them to your server.

No comments: