Changeset 2298277
- Timestamp:
- 05/05/2020 08:07:04 AM (4 years ago)
- Location:
- recently-purchased-product-list-for-woocommerce/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
recently-purchased-product-list-for-woocommerce/trunk/readme.txt
r2252258 r2298277 1 1 === Woo recently sold items list === 2 2 Contributors: mehedi_csit 3 3 4 Tags: woocommerce,recently, sold,product,list 4 5 Requires at least: 4.2 5 Tested up to: 5. 2.56 Tested up to: 5. 6 7 Requires PHP: 5.4 7 8 Stable tag: 1.0.0 -
recently-purchased-product-list-for-woocommerce/trunk/woo-recently-purchased-product-list.php
r2252258 r2298277 3 3 Plugin Name: Woo recently sold items list 4 4 Description: With this plugin you can show recently sold items list for woocommerce under single product page and with shortcode you can show anywhere. 5 Plugin URI: https://www. workwithmehedi.com5 Plugin URI: https://www.withmehedi.com 6 6 Version: 1.0.0 7 7 Author: Mehedi Hasan 8 Author URI: https:// www.facebook.com/mehedicsit8 Author URI: https:// 9 9 License: GPL-2.0+ 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.txt … … 18 18 19 19 // enqueue scripts 20 function wcrspl_scripts_register() {20 function wcrspl_scripts_register(){ 21 21 22 22 wp_enqueue_style( 'wcrspl_custom_css', plugins_url('scripts/wcrspl-style.css', __FILE__) ); 23 wp_enqueue_script( 'wcrspl_custom_script', plugins_url('scripts/wcrspl-custom.js', __FILE__), array('jquery'), null,true);23 wp_enqueue_script( 'wcrspl_custom_script', plugins_url('scripts/wcrspl-custom.js', __FILE__), array('jquery'),); 24 24 25 25 } … … 49 49 ); 50 50 51 51 $orders = wc_get_orders($args); 52 52 $products = []; 53 53 54 foreach ( $orders as $order) {54 foreach () { 55 55 $items = $order->get_items(); 56 56 57 foreach ( $items as $item) {58 array_push( $products, $item->get_product_id());57 foreach () { 58 array_push(); 59 59 60 60 } 61 61 } 62 $products = count( $products) ? $products : [0];62 $products = count() ? $products : [0]; 63 63 $query_args = array( 64 64 'posts_per_page' => 3, … … 72 72 <?php 73 73 74 if ( $recentlyOrderedItems->have_posts()):75 while ( $recentlyOrderedItems->have_posts()): $recentlyOrderedItems->the_post();?>74 if (): 75 while (): $recentlyOrderedItems->the_post();?> 76 76 <!-- code here --> 77 77 <li class="wcrspl-item"> … … 86 86 </p> 87 87 <p class="wcrspl-item-view"> 88 <a class="button add_to_cart_button" href="<?php echo esc_url($product->add_to_cart_url());?>"> View Product</a>88 <a class="button add_to_cart_button" href="<?php echo esc_url($product->add_to_cart_url());?>"></a> 89 89 </p> 90 90 </li> … … 101 101 } 102 102 else{ 103 add_action('admin_notices', function() {103 add_action('admin_notices', function(){ 104 104 echo '<div class="notice notice-error"><p>'.esc_html__('Stock Status Bar For Woocommerce requires WooCommerce to be installed and active. You can download', 'wcrspl').' <a href="https://woocommerce.com/" target="_blank">WooCommerce</a> '.esc_html__('here.','wcrspl').'</p></div>'; 105 105 });
Note: See TracChangeset
for help on using the changeset viewer.