Dplugins Logo
  • Code Snippets
  • Code Request
  • Register
    • Register as Contributor
    • Editor Guidelines
  • Account
  • Redirect to page if only 1 result is found

    Redirect to page if only 1 result is found

    Use this code to redirect a viewer directly to the page, if only 1 search result is found. Useful when people know exactly the model number they want for an ecom store.

    Category: WordPress

    smartsovereign

    Tags: single product, WooCommerce
  • woocommerce product custom gallery slider example

    woocommerce product custom gallery slider example

    Here is an example code snippet for creating a custom gallery slider for WooCommerce products: In this example, we are using the woocommerce_product_thumbnails action hook to add a custom gallery slider to the product page. We are using the Owl Carousel jQuery plugin to create the slider and enqueueing its required CSS and JS files.…

    Category: Oxygen, WooCommerce

    Sumit Singh

    Tags: hook, single product, Tips, WooCommerce
  • Notify Admin When New Account Is Created

    Notify Admin When New Account Is Created

    Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Scripts organizer plugin. Avoid adding custom code directly to your parent theme’s functions.php file, as this will be wiped entirely when you update the theme.

    Category: WooCommerce, WordPress

    Sumit Singh

    Tags: Tips, WooCommerce
  • WooCommerce Product Slider with flexslider js in Oxygen

    WooCommerce Product Slider with flexslider js in Oxygen

    Create template that applies to Singular Products with Oxygen or if you have already created then edit. Add a Code Block where you want to display the product slider. Advanced > Size & Spacing > Width: 100%. PHP & HTML: I have added flexslider js and css CDN live link. So you can do on…

    Category: JavaScript, Oxygen, WooCommerce, WordPress

    Sumit Singh

    Tags: flexslider, Gallery, single product, WooCommerce
  • Woo: Change the No Product in cart text on the Oxy Ultimate Woo plugin

    Woo: Change the No Product in cart text on the Oxy Ultimate Woo plugin

    This is a snippet for Oxy Ultimate Woo plugin that allows you to change the default “No product in cart” to anything you like. Credit to the Developer, you can see the original code here

    Category: WordPress

    smartsovereign

    Tags: 3rd party plugins, WooCommerce
  • Woo: How to change CHECKOUT text button on Oxy Ultimate Woo Cart

    Woo: How to change CHECKOUT text button on Oxy Ultimate Woo Cart

    Fo those using Oxy Ultimate Woo Cart component, this is a snippet to change the text on the checkout button to anything you need. This is courtesy of the developer and work perfectly, see original here

    Category: WordPress

    smartsovereign

    Tags: 3rd party plugins, WooCommerce
  • Disable WooCommerce Marketing menu

    Disable WooCommerce Marketing menu

    Add the following PHP code snippet in your favorite code manager plugin like Scripts organizer and set it to load on front end

    Category: Oxygen, WooCommerce

    Sumit Singh

    Tags: hook, WooCommerce, WP Admin
  • Woo: Change Add to Cart to BUY NOW

    Woo: Change Add to Cart to BUY NOW

    Another little Woo Commerce polish to make your store look even more customised

    Category: WooCommerce

    smartsovereign

    Tags: WooCommerce
  • Woo : Change “Out of Stock” to SOLD OUT

    Woo : Change “Out of Stock” to SOLD OUT

    This is a quality of life improvement for an ecommerce store.

    Category: WooCommerce

    smartsovereign

    Tags: WooCommerce
  • Woo: Rename “add to cart” button if product already in cart

    Credit: https://businessbloomer.com/ for this one. Check out his website, he has hundreds of useful Woo snippets. When talking about UX, or for very specific WooCommerce shops, you might need to tell the user a product is already in the Cart before re-adding it or increasing its quantity from the Shop/Category/Loop and Single Product pages. This…

    Category: WooCommerce

    smartsovereign

    Tags: Front End, WooCommerce
  • Woo: Hide add to cart pop up

    If you set up a one page checkout on oxygen or have a sidecart, you don’t want to see this pop up, as people may click it and go to the cart page (which you want to skip altogether), this hides that pop up.

    Category: WooCommerce

    smartsovereign

    Tags: WooCommerce
  • Woo: Re-order catalogue with out of stock items last

    Credit: https://businessbloomer.com/ for this one. Check out his website, he has hundreds of useful Woo snippets. This is useful so that your customer only sees your current stock.

    Category: WooCommerce

    smartsovereign

    Tags: WooCommerce
  • Woo: Disable WooCommerce image zoom

    Woo: Disable WooCommerce image zoom

    Sometimes the zoom feature is useful, but it can also be very jarring to your customers. I prefer to have this off on every site and use a light box instead.

    Category: WooCommerce

    smartsovereign

    Tags: Must Have, WooCommerce
  • Redirect wordpress back to referring page after login

    Sometimes you have a situation where you want the customer to log in, like a donation page, but you don’t want them to end up at /my-account/ but rather be taken back to the page where they were when they started. This code is useful for donation sites, as well as refer a friend scenarios.

    Category: WordPress

    smartsovereign

    Tags: WooCommerce, WP Admin
  • Log out to home page

    Log out to home page

    This snippet is good for e-commerce stores or anywhere that customers can be logged in, it ensures they don’t see the default WordPress login page, but are instead taken to the home page.

    Category: WordPress

    smartsovereign

    Tags: Must Have, WooCommerce, WP Admin
  • Show/hide section based on Number of WooCommerce Upsells in Oxygen on single product

    Show/hide section based on Number of WooCommerce Upsells in Oxygen on single product

    1st Step Install and activate Code Snippets plugin. Add below code in code snippets: 2nd Step Edit the Oxygen Template that applies to woo single products. For the element you want to apply the “minimum 1 upsell” condition, click on Conditions icon then Set Conditions. Click “Add Condition” icon. Choose Dynamic Data condition. Under Advanced click PHP Function Return value. Function Name: wpl_check_upsell_product…

    Category: Oxygen, WooCommerce

    Sumit Singh

    Tags: single product, Upsells, WooCommerce
  • Cart count / total price

    Cart count / total price

    With this example you can easily add cart count or total price anywhere on your webshop. This code uses woocommerce add to chart hook that is executed every time when you put something into basket. You just need to add this code anywhere where you wish to show total price. And this snippet will execute…

    Category: WooCommerce, WordPress

    Davor Mlinarić

    Tags: hook, WooCommerce
  • Add WooCommerce Cart Icon on your website with Cart Item Count

    Add WooCommerce Cart Icon on your website with Cart Item Count

    Here is a way to add WooCommerce cart icon to a menu with the cart item count, it links to the cart page and displays the number of items that have been added to the cart.The code uses three functions which need to be added to Snippet plugin. Create a shortcode for the WooCommerce cart,…

    Category: Oxygen, WooCommerce, WordPress

    Sumit Singh

    Tags: Cart, Tutorial, WooCommerce
  • Fetch best seller of WooCommerce in oxygen repeater / Easy posts

    Fetch best seller of WooCommerce in oxygen repeater / Easy posts

     For retrieving the best buying products in WooCommerce we are using wp_query manipulation with meta_key as “total_sales” and orderby “meta_value_num”. In short we are displaying products as per the total sales number. Here is Screenshot for repeater / easy posts Step 1 – Select Advance WP Query Step 2 – Setup Advance WP Query as…

    Category: Oxygen, WooCommerce, WordPress

    Sumit Singh

    Tags: best seller, Easy posts, repeater, WooCommerce

3rd party plugins admin after_body Alt archive Blocks Category clean up composite elemenets core CPT CSS Custom Custom Post Dashboard flexslider Front End FSE full site editing Gallery hook HTML Image load styles Must Have notice Oxygen Password Permalink plugins Post List Publish Date repeater settings page share single product Taxonomy Taxonomy Term themes Tips Topbar WooCommerce wordpress WP Admin WPML

Proudly Powered by DPlugins