If your store will only be using PayPal as a payment handler, the customer experience can be improved by replacing the "Confirm Order" button at the end of the checkout process with an actual PayPal button.
The old button doesn't convey to your customer that they will be taken to PayPal to complete their order.
The old button doesn't convey to your customer that they will be taken to PayPal to complete their order.
All we're going to do with this post, is show how to change that "Confirm Order" button into this a Paypal button
The file you want to edit is found here:
\components\com_virtuemart\themes\default\templates\checkout\get_final_confirmation.tpl.php
Within this file, search near the bottom for the following code:
<div align="center"> <input type="submit" onclick="return( submit_order( this.form ) );" class="button" name="formSubmit" value="<?php echo $VM_LANG->_('PHPSHOP_ORDER_CONFIRM_MNU') ?>" /> </div>
The button has a class called input.button found in your templates css file, but we’ll be changing it to a specific id. Basically, the idea will be to remove the text that is shown so delete the PHP echoed text. On top of that, we need to change the class to a class or id (this example will assign an id) to handle the new appearance.
The old code should be changed to something similar to the code shown below:
The old code should be changed to something similar to the code shown below:
<div align="center"> <input type="submit" onclick="return( submit_order( this.form ) );" id="confirm_button" name="formSubmit" value="" /> </div>
Notice, in the above code, that the id of the button has been changed to confirm_button. You can give it whatever declaration you wish, but you just need it to be unique. You will declare a style for it in your CSS file. We are going to add the id declaration to the template css (ie. template.css) where the class input.button is declared.
Now, go to your template css file and search for the class input.button. Create 2 new id declarations similar to the button class declarations:
Now, grab a PayPal image from the PayPal site. Just right-click and select save image. They give you the option to point to an image on their server, but it’s better to host your own image so that you’re in control if they decide to update their images, again, in the future.
Now, you need to edit your CSS entries for the new button id. Check the width and height of the image you downloaded and enter them into the CSS class. You can play around with the padding, but I just left it the same as the button class. The background image will be the location of the image on your server relative to this CSS file.
1) get_final_confirmation.tpl.php -> with the edited submit button code.
2) the CSS file you edited with the new id for your submit button.
3) the PayPal image in the correct directory relative to your CSS file where it is mentioned.
In summary, you need to edit the style of submit button in get_final_confirmation.tpl.php and remove it’s text that gets echoed to the screen. You then need to either handle the style change right there in the file or in your general CSS file. You will also need to provide the PayPal image to show, which can be found by searching for PayPal images or by going to the link mentioned above in this article. You may need to edit the button (borders, background color) to get it to fit in with your site.
Overall, this is a great way to customize a site that will only rely on PayPal as your payment option. Adding an actual PayPal button gives your visitors a clear message of where they are going when they click on the button.
Now, go to your template css file and search for the class input.button. Create 2 new id declarations similar to the button class declarations:
#confirm_button{ } #confirm_button:hover, #confirm_button:focus{ }
Now, grab a PayPal image from the PayPal site. Just right-click and select save image. They give you the option to point to an image on their server, but it’s better to host your own image so that you’re in control if they decide to update their images, again, in the future.
Now, you need to edit your CSS entries for the new button id. Check the width and height of the image you downloaded and enter them into the CSS class. You can play around with the padding, but I just left it the same as the button class. The background image will be the location of the image on your server relative to this CSS file.
#confirm_button{ width:145px; height:42px; padding: 3px 5px; background: url(../images/btn_xpressCheckout.gif) no-repeat top #FFFFFF; }For the hover and focus traits, change the cursor to a pointer. Changing it to an pointer gives this background image the semblance of being an actual button.
#confirm_button:hover, #confirm_button:focus { cursor: pointer; }After this, you will need to upload 3 files to your server:
1) get_final_confirmation.tpl.php -> with the edited submit button code.
2) the CSS file you edited with the new id for your submit button.
3) the PayPal image in the correct directory relative to your CSS file where it is mentioned.
In summary, you need to edit the style of submit button in get_final_confirmation.tpl.php and remove it’s text that gets echoed to the screen. You then need to either handle the style change right there in the file or in your general CSS file. You will also need to provide the PayPal image to show, which can be found by searching for PayPal images or by going to the link mentioned above in this article. You may need to edit the button (borders, background color) to get it to fit in with your site.
Overall, this is a great way to customize a site that will only rely on PayPal as your payment option. Adding an actual PayPal button gives your visitors a clear message of where they are going when they click on the button.
Comments
Post a Comment