RapidCart Pro E-commerce
The RapidCart Pro plugin provides RapidWeaver users and developers alike with a technique to display the number of items in a shopping cart or the total value of the cart contents. The technique uses some 'copy and paste' PHP markup to accomplish this. This code can be entered into any part of your page, a sidebar or a theme ExtraContent container. If for example you were using the Boutique theme, then you would enter the markup in your ExtraContent2 container, to display the cart total or quantity alongside your page navigation links at the top.
This HTML and PHP markup works by 'echoing' the address, total or quantity from the cart. The system we use here ensures that the cart automatically updates, when items are added or removed from the cart; preventing the need for customers to manually refresh the page. Needless to say, this markup will only work on RapidCartPro page types. It will not work on pages outside of RapidCartPro, and may give HTML validation errors / warnings as a result.
To display the total value of items in the cart, use this markup:
<div id="cartTotal" class="cartTotal"> <a href=""> <i class="fa fa-shopping-cart"></i> <span class=""></span> </a> </div>
To display the quantity (number) of items in a shopping cart, use this markup:
<div id="cartQuantity" class="cartQuantity"> <a href=""> <i class="fa fa-shopping-cart"></i> <span class=""></span> </a> </div>
In both instances we include a nice little Font Awesome shopping cart icon to keep things looking pretty! We wrap both the icon and totals inside a link, which will automatically link to the RapidCartPro cart page. This makes it really easy and convenient for a customer to click the cart total, and get taken straight to the cart or checkout interface.
Building on the above examples, if for example you wanted to display the cart total in ExtraContent2, then this would be the complete markup to use:
<div id="myExtraContent2"> <div id="cartTotal" class="cartTotal"> <a href=""> <i class="fa fa-shopping-cart"></i> <span class=""></span> </a> </div> </div>
This just gets pasted straight into your main page content container or sidebar. Ensure that the target ExtraContent container is enabled in the theme settings (if it has on / off options). If pasting into a styled text content container, highlight the markup and set it to ignored format, in the RapidWeaver Format menu. It's normal for the cart not to get shown in RapidWeaver preview mode; it uses PHP code so it needs to be published to a live web server before it will work.
There is definitely scope to further-expand on the examples documented above. If space permits, you could build a 'mini' cart in a theme ExtraContent container or sidebar, to display both the cart total, cart quantity and link in combination together. Style your new cart with icons, borders, backgrounds or other effects.