Skip to main content

Developer’s Note: Condensing Forms Displayed During VirtueMart Checkout

By default, the VirtueMart checkout process will ask for more information from your customer than is actually needed by your store.  To help reduce the form-field overload that you customer may face when trying to purchase a product from your online store, it can help to actually remove fields that are not necessary to your business.   Do you really need to know the “company", "title", or "fax number” of a customer?  If not, then this tutorial will show you how to remove those fields.

Changing the following file will impact the Billing Information and the Shipping Information (Shipping Address) forms that appear during the VirtueMart checkout process.

The file you will need to edit can be found here:

/administrator/components/com_virtuemart/classes/ps_userfield.php

Search for the function getSkipFields()

By default, the skipped fields are the username, password, password check, and the check for the terms of service agreement.

function getSkipFields() {
return array( 'username', 'password', 'password2', 'agreed' );
}

What this function does is returns an array to the caller of the fields that should be skipped when generating the forms.  The choice for fields are (* required by VirtueMart):

  • username
  • password
  • password2
  • agreed
  • company
  • title
  • fax
  • phone*
  • phone_2
  • first_name*
  • middle name
  • last_ name*
  • city*
  • address*
  • address_2
  • zip*
  • country*
  • state*

You can add any of the above fields to the return array.  For example:

function getSkipFields() {
return array( 'username', 'password', 'password2', 'agreed', 'company', 'title', 'fax', 'phone_2', 'middle_name' );
}

After adding the fields that you don’t want shown, you need to make one more change to the ps_userfield.php file.

Search for the function getUserFields and change the variable $exclude_skipfields to true.  Basically, this will tell the function to obey the array in getSkipFields() when generating the form for user information.

The final step is to edit the following file which displays the information back to the user on the shipping address page:

/components/com_virtuemart/themes/default/templates/checkout/customer_info.tpl.php


Look within this file and remove the table rows that correspond with the fields that your removed.  For example, if you added company to the skip fields array above, you will want to remove the entire row that displays company in customer_info.tpl.php.

After you have completed those two steps, upload the files to your server and you should see the changes immediately.

Comments

Popular posts from this blog

How To Run Chrome From Within Notepad++

If you have recently tried to Run  Chrome from within Notepad++ recently, you've probably encountered the same issue I did.  Chrome didn't run. The fix is actually really simple.  Open up the Run box in Notepad++ and browse to your installation of Chrome. ie.  C:\Program Files\Google\Chrome\Application\Chrome.exe Select the file when you find it.  Now, the trick is: Put quotation marks around the path you see in the Run  box.  Now, put 1 space after the closing quotation mark. Type this: $(FULL_CURRENT_PATH) It'll look something like this: Click Run .  If Chrome opens, click Save and set your hotkey.

Developer Note: Virtuemart - Editing the Add to Cart MooTool Popup

To edit the “Add To Cart” popup that appears when you add an item to a cart in Virtuemart, there are few files that you need to know about. These are the files to know \components\com_virtuemart\themes\default\theme.js \components\com_virtuemart\js\mootools\   - contains the files for editing the appearance of the popup. To edit the appearance of the box, edit \components\com_virtuemart\js\mootools\mooPrompt.css to change the styles as well as editing the 2 images in the directory to edit how they appear as well (close box and header-background)

Divi Theme - Remove pause 'on hover' of the full width slider

In the Divi theme, open up /js/custom.js Comment out the following code (around line 144) if ( settings.slideshow && et_slides_number > 1 ) { $et_slider.hover( function() { $et_slider.addClass( 'et_slider_hovered' ); if ( typeof et_slider_timer != 'undefined' ) { clearInterval( et_slider_timer ); } }, function() { $et_slider.removeClass( 'et_slider_hovered' ); et_slider_auto_rotate(); } ); }