Code snippets are often a good way to add minor functionality without the need for extra plugins. The code should be added to either the functions.php file in a child theme, or into a plugin that you have added specifically for that purpose.
For more on child themes refer to this page: https://www.classicpress.net/blog/creating-a-child-theme/
You can download a basic Classic Commerce snippet plugin here: cc-snippets.zip
This plugin contains a few snippets to get you started. Install the plugin it and activate it in the usual way. Then delete the snippets you don’t need and add others as required.
The code samples below are divided into three broad categories:
- Add or apply snippets add extra functionality.
- Modify snippets change the way some existing processes work.
- Remove or hide snippets take away some existing functionality.
You can search for snippets by using the tags.
✓ = tested on ClassicPress 1.2.0
- Add a ‘Back to Shop’ button on product page ✓
- Add custom message at payment button ✓
- Add a payment gateway surcharge to checkout ✓
- Add extra fields to checkout process ✓
- Add country prefix before $ in prices ✓
- Add a custom message to the login page ✓
- Add short description to category page ✓
- Add prefix to prices ✓
- Add suffix to prices ✓
- Add shortcode to make link to individual product ✓
- Add quantity selector to the category page ✓
- Add ‘New’ badge for recently added items ✓
- Add another email recipient when order completed ✓
- Add custom content to a specific customer order email ✓
- Add custom row to order email table ✓
- Add a custom currency and currency symbol ✓
- Add coupon code to order details and emails ✓
- Apply a coupon discount for minimum cart total ✓
- Apply weight-based shipping options to checkout ✓
- Ask for donation in checkout process ✓
- Create a shortcode to add a specific product price ✓
- Display total weight on cart and checkout pages ✓
- Display extra amount needed for free shipping ✓
- Display ‘Out of stock’ on category pages ✓
- Display category image on category archive page ✓
- Include a ClassicPress page on order received page ✓
- Set a minimum order quantity for checkout ✓
- Set a minimum order amount for checkout ✓
- Set an order quantity multiple for checkout ✓
- Set discount for bulk buying ✓
- Show product dimensions on category page ✓
- Show product weight on category pages ✓
- Show default short description if empty ✓
MODIFY OR CHANGE (33)
- Auto complete all Classic Commerce orders ✓
- Change number of thumbnails per row in product gallery ✓
- Change ‘Add to cart’ text when product added to cart ✓
- Change any text string in Classic Commerce ✓
- Change the breadcrumb separator ✓
- Change text on sale button ✓
- Change number of products per row ✓
- Change number of products that are displayed per page ✓
- Change address checkout fields to textarea ✓
- Change postcode/zipcode from required to optional ✓
- Combine cart and checkout on same page ✓
- Deny checkout based on cart weight ✓
- Display FREE if price zero or empty ✓
- Display a video instead of the single product image ✓
- Extend Classic Commerce order number ✓
- Modify the ‘no shipping available’ message ✓
- Move product tabs beside the product images ✓
- Order products by price, date or title ✓
- Redirect to front-end after user login ✓
- Redirect main shop page ✓
- Redirect the home link URL in the breadcrumb ✓
- Rename ‘home’ in breadcrumb ✓
- Rename checkout fields ✓
- Rename ‘Description’ tab label ✓
- Rename ‘Additional Information’ tab label ✓
- Rename ‘Reviews’ tab label ✓
- Replace ‘out of stock’ message by ‘sold’ ✓
- Replace Classic Commerce default PayPal icon ✓
- Show out of stock variation selections as grey ✓
- Show normal price, new price and savings ✓
- Show SKU in the cart ✓
- Skip cart and go straight to checkout ✓
- Trim zeros in price decimals ✓
REMOVE OR DISABLE OR HIDE (28)
- Disable zoom feature on product page images ✓
- Disable all payment gateways on checkout page ✓
- Disable default Classic Commerce stylesheets ✓
- Email admin when a new customer account is created ✓
- Exclude products in some categories from the shop ✓
- Hide custom fields and download boxes on order details ✓
- Hide prices and cart buttons if user not logged in ✓
- Hide SKUs in frontend only, or completely ✓
- Hide product count on category display pages ✓
- Hide ‘read more’ buttons for out of stock items ✓
- Hide shipping on cart ✓
- Hide shipping rates when free shipping is available ✓
- Hide price and cart button for selected categories ✓
- Make Classic Commerce a catalogue site, hide selling functions ✓
- Remove meta info from the products page ✓
- Remove related products section ✓
- Remove additional information tab ✓
- Remove tags meta box from product data page ✓
- Remove ‘description’ heading under single product tab ✓
- Remove dropdown ordering box on category page ✓
- Remove result count from category page ✓
- Remove links to individual products on category page ✓
- Remove fields in the checkout process ✓
- Remove product links for items in cart ✓
- Remove ‘What is PayPal?’ link and logo ✓
- Remove breadcrumbs ✓
- Remove Classic Commerce options from Customizer ✓
- Remove the Classic Commerce dashboard widget ✓
- Simplify checkout if only virtual products ✓
account1 add21 additional2 admin1 amount2 apply2 back1 badge1 breadcrumb4 bulk1 button5 cart11 catalogue1 category13 change9 checkout17 combine1 complete1 count2 country1 coupon2 currency1 custom6 customer1 customizer1 dashboard1 date1 default1 deny1 description4 dimensions1 disable3 discount2 display6 donation1 dropdown1 email5 empty2 exclude1 extend1 field4 free3 front1 gallery1 gateway2 grey1 hide12 home2 icon1 image1 images2 include1 information2 limit1 link5 login3 logo1 message5 meta3 minimum3 modify11 move1 multiple1 new2 number2 optional1 options1 order6 page4 payment3 paypal2 postcode1 prefix2 price9 product23 quantity3 read1 received1 redirect4 related1 remove24 rename5 replace2 required1 result1 review1 row2 sale1 saving1 selector1 separator1 set4 shipping5 shop2 short1 shortcode2 show6 simplify1 skip1 sku2 sold1 sort1 stock4 straight1 stylesheet1 suffix1 surcharge1 symbol1 tab6 tag1 text3 textarea1 thumbnail1 title1 total1 trim1 variation1 video1 virtual1 weight4 widget1 zero2 zipcode1 zoom1