Plugin Directory

Changeset 2298277

Timestamp:
05/05/2020 08:07:04 AM (4 years ago)
Author:
mehedi_csit
Message:

fixed coding standards and added donation link

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  
    11=== Woo recently sold items list ===
    22Contributors: mehedi_csit
     3
    34Tags: woocommerce,recently, sold,product,list
    45Requires at least: 4.2
    5 Tested up to: 5.2.5
     6Tested up to: 5.
    67Requires PHP: 5.4
    78Stable tag: 1.0.0
  • recently-purchased-product-list-for-woocommerce/trunk/woo-recently-purchased-product-list.php

    r2252258 r2298277  
    33Plugin Name: Woo recently sold items list
    44Description: 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.com
     5Plugin URI: https://www.withmehedi.com
    66Version: 1.0.0
    77Author: Mehedi Hasan
    8 Author URI: https://www.facebook.com/mehedicsit
     8Author URI: https://
    99License: GPL-2.0+
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.txt
     
    1818
    1919// enqueue scripts
    20 function wcrspl_scripts_register(){
     20function wcrspl_scripts_register(){
    2121
    2222  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'),);
    2424
    2525}
     
    4949);
    5050
    51       $orders = wc_get_orders($args);
     51$orders = wc_get_orders($args);
    5252$products = [];
    5353
    54 foreach ($orders as $order) {
     54foreach () {
    5555    $items = $order->get_items();
    5656
    57     foreach ($items as $item) {
    58         array_push($products, $item->get_product_id());
     57    foreach () {
     58        array_push();
    5959
    6060    }
    6161}
    62 $products = count($products) ? $products : [0];
     62$products = count() ? $products : [0];
    6363$query_args = array(
    6464    'posts_per_page' => 3,
     
    7272<?php
    7373
    74 if ($recentlyOrderedItems->have_posts()):
    75     while ($recentlyOrderedItems->have_posts()): $recentlyOrderedItems->the_post();?>
     74if ():
     75    while (): $recentlyOrderedItems->the_post();?>
    7676                    <!-- code here -->
    7777                    <li class="wcrspl-item">
     
    8686                        </p>
    8787                        <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>
    8989                        </p>
    9090                    </li>
     
    101101}
    102102else{
    103     add_action('admin_notices', function(){
     103    add_action('admin_notices', function(){
    104104        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>';   
    105105    });
Note: See TracChangeset for help on using the changeset viewer.