mercredi 1 juin 2016

Woocommerce - Product variations not appear on "view order"

Good afternoon

I'm finishing a project of a virtual store with Woocomerce.

Signed up the product and its variables, make the choice of variables (quantity controls and color controls), go to the cart page (/ cart).

There displays the product and its variations, proceed to the checkout and also appears the options chosen.

When I finish the purchase if I'm going on the "view request", the name of the product, the name of variation but it appears selected variations.

And do not get selected variations in the application of e-mail, someone can help me?

Thank you



via Chebli Mohamed

Creating Wordpress Widget - $wpdb not working

I am trying to make a simple wordpress widget to display the amount of offers and bonuses available on my website. Unfortunately, it seems to be crashing, like something is missing.

Here is my code:

        // Block direct requests
    if ( !defined('ABSPATH') )
    die('-1');


add_action( 'widgets_init', function(){
     register_widget( 'MatchedBettingBonusCount' );
}); 

/**
 * Adds MatchedBettingBonusCount widget.
 */
class MatchedBettingBonusCount extends WP_Widget {

    /**
     * Register widget with WordPress.
     */
    function __construct() {
        parent::__construct(
            'MatchedBettingBonusCount', // Base ID
            __('MatchedBettingBonusCount', 'text_domain'), // Name
            array( 'description' => __( 'My first widget!', 'text_domain' ), ) // Args
        );
    }

    /**
     * Front-end display of widget.
     *
     * @see WP_Widget::widget()
     *
     * @param array $args     Widget arguments.
     * @param array $instance Saved values from database.
     */
    public function widget( $args, $instance ) {

        $sqlOfferCount = "SELECT * FROM vhyky_posts WHERE post_type =  'cs_cause' AND post_status =  'publish'";
        $sqlOfferSum = "SELECT sum(vpm.meta_value) FROM vhyky_posts vp, vhyky_postmeta vpm WHERE post_type = 'cs_cause' AND post_status =  'publish' AND vp.id = vpm.post_id"

        global $wpdb;
        $offerCount = $wpdb->get_results($sqlOfferCount);
        $offerSum = $wpdb->get_results($sqlOfferCount);


        echo $args['before_widget'];
        if ( ! empty( $instance['title'] ) ) {
            echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ). $args['after_title'];
        }
        echo __('We currently have <strong>'.$offerCount. '</strong> sign-up offers. Totalling an amazing <strong>&pound;'. $offerSum .'</strong> of bonuses' , 'text_domain' );
        echo $args['after_widget'];
    }

    /**
     * Back-end widget form.
     *
     * @see WP_Widget::form()
     *
     * @param array $instance Previously saved values from database.
     */
    public function form( $instance ) {
        if ( isset( $instance[ 'title' ] ) ) {
            $title = $instance[ 'title' ];
        }
        else {
            $title = __( 'New title', 'text_domain' );
        }
        ?>
        <p>
            <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label> 
            <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>">
        </p>
        <?php 
    }

    /**
     * Sanitize widget form values as they are saved.
     *
     * @see WP_Widget::update()
     *
     * @param array $new_instance Values just sent to be saved.
     * @param array $old_instance Previously saved values from database.
     *
     * @return array Updated safe values to be saved.
     */
    public function update( $new_instance, $old_instance ) {
        $instance = array();
        $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';

        return $instance;
    }

} // class My_Widget

A lot of the stuff I have been trying seems to be out of date.



via Chebli Mohamed

RedirectURL Issues with Sagepay Server & Woocommerce

I am using Patsatech SagePay Server plugin for Woocommerce (http://ift.tt/1Zdd6a9). I have the latest version of WooCommerce (2.5.5) running on the latest version of Wordpress (4.5.2).

I have a site that has SagePay Server in which the Transaction Type is set to Authenticate.

When I go through the checkout process I can get all the way through the checkout fine, until it redirects me back to the website. Rather than seeing the success page I add redirected back to the cart page, with no message to say whether its been a failure or a success.

I have spoken to SagePay support and they state that the process is correct there end but the redirectURL they are given is incorrect.

Here is the redirectURL from their logs:

http://ift.tt/1Xgu3mR 4ebc695fcfd&amp;order_id=48113&amp;redirect&amp;_wpnonce=e8a503fc0c

I have put a post on the WordPress forum and submitted a support ticket to PatsaTech but I thought I would try here as well in case anyone has had the same issue.

I am guessing the redirectURL needs changing somehow but whether this is an issue with the plugin or it could be solved another way, I dont know?



via Chebli Mohamed

Facing issue in making a wordpress Plugin

FATAL ERROR: MAXIMUM FUNCTION NESTING LEVEL OF '100' REACHED, ABORTING!

This Error is showing in Wordpress while I create my Plugin's shortcode in a page.

Not finding any error for that how to solve this problem.



via Chebli Mohamed

Using the Soliloquy plug-in how do you reposition the navigation arrows for the sliders images?

I want to reposition the navigation arrows to each side of the slider images instead of having it positioned on the sliders background, using Wordpress.



via Chebli Mohamed

WooCommerce : Display items in order including image

I am trying to display the products/items within a WooCommerce order using the following php, but the items are not being shown.

The code I am using is an adaptation of this: Get cart item name, quantity all details woocommerce

Using the original code from the question above also does not display anything on my page:

global $woocommerce;
$items = $woocommerce - > cart - > get_cart();

foreach($items as $item => $values) {
    $_product = $values['data'] - > post;
    //product image
    $getProductDetail = wc_get_product($values['product_id']);
    echo '<tr><td>';
    echo $getProductDetail - > get_image(); // accepts 2 arguments ( size, attr )
    echo '</td>';
    echo '<td>';
    echo '<p style="font-size:10pt;">'.$_product - > post_title.
    '</p><td><p style="font-size:10pt;">x'.$values['quantity'].
    '</p></td>';
    echo '</td></tr>';
};

The full page code is here:

<?php 
/* Template Name: Store */ 
if (!is_user_logged_in() || !current_user_can( 'manage_options')) wp_die( 'This page is private.'); ?>
<!DOCTYPE HTML>
<html>

<head>
    <script src="http://ift.tt/1UJY7W4"></script>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>
        <?php _e( 'Store Queue'); ?>
    </title>
</head>

<body id="driverqueue">
    <header>
        <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

        <h1 class="title"><?php the_title(); ?></h1>

        <?php the_content(); ?>

        <?php endwhile; endif; ?>
    </header>
    <section>
        <?php global $woocommerce; $args=a rray( 'post_type'=> 'shop_order', 'post_status' => 'wc-processing', 'meta_key' => '_customer_user', 'posts_per_page' => '-1' ); $my_query = new WP_Query($args); $customer_orders = $my_query->posts; foreach ($customer_orders as $customer_order) { $order = new WC_Order(); $order->populate($customer_order); $orderdata = (array) $order; // $orderdata Array will have Information. for e.g Shippin firstname, Lastname, Address ... and MUCH more.... Just enjoy! } $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); $order_id = $loop->post->ID; $order = new WC_Order($order_id); ?>
        <table class="ordertable" id="<?php echo $order_id; ?>">
            <tr>
                <td>
                    <p>Order #
                        <?php echo $order_id; ?> &mdash;
                        <time datetime="<?php the_time('c'); ?>">
                            <?php echo the_time( 'd/m/Y g:i:s A'); ?>
                        </time>
                    </p>
                </td>
                <td>
                    <?php echo $order->billing_first_name . ' ' . $order->billing_last_name ?>
                </td>
                <td>
                    <table>
                        <tr>

                            <?php global $woocommerce; $items=$ woocommerce->cart->get_cart(); foreach($items as $item => $values) { $_product = $values['data']->post; //product image $getProductDetail = wc_get_product( $values['product_id'] ); echo '
                            <tr>
                                <td>'; echo $getProductDetail->get_image(); // accepts 2 arguments ( size, attr ) echo '</td>'; echo '
                                <td>'; echo '
                                    <p style="font-size:10pt;">'.$_product->post_title.'</p>
                                    <td>
                                        <p style="font-size:10pt;">x'. $values['quantity'] . '</p>
                                    </td>'; echo '</td>
                            </tr>'; }; ?>
                        </tr>
                    </table>
                </td>
                <td>
                    <p>
                        <?php do_action( 'woocommerce_admin_order_actions_start', $order ); $actions=a rray(); if ( $order->has_status( array( 'pending', 'on-hold', 'processing' ) ) ) { $actions['complete'] = array( 'url' => wp_nonce_url( admin_url( 'admin-ajax.php?action=woocommerce_mark_order_status&status=awaiting-shipment&order_id=' . $post->ID ), 'woocommerce-mark-order-status' ), 'name' => __( 'Complete', 'woocommerce' ), 'action' => "complete" ); }; $actions = apply_filters( 'woocommerce_admin_order_actions', $actions, $order ); foreach ( $actions as $action ) { printf( '<a class="button %s" href="%s" data-tip="%s">%s</a>', esc_attr( $action['action'] ), esc_url( $action['url'] ), esc_attr( $action['name'] ), esc_attr( $action['name'] ) ); } do_action( 'woocommerce_admin_order_actions_end', $order ); ?>
                    </p>
                </td>
                <td>
                    <form action="">
                        <input type="checkbox" class="ordercollected" value="0" />
                    </form>
                </td>
            </tr>
            <?php endwhile; ?>

    </section>
</body>

</html>



via Chebli Mohamed

Marathi typing option in wordpress Editor

wordpress i want to input marathi language from wordpress editor. After googling a lot, i am got getting how this can be done .There must be some way to do this
Is the a possible to add marathi language in wordpress default editor .



via Chebli Mohamed