Lacking some functions after vendor listing checkout

Home Forums WordPress Theme CityBook – Directory & Listing WordPress Theme Lacking some functions after vendor listing checkout

This topic contains 8 replies, has 2 voices, and was last updated by  CTHthemes 4 weeks ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #28687

    samsun34567
    Participant

    Support Expired

    Hi,

    I noticed there seems to lack some sort of confirmation/thank you after a vendor finishes purchasing a listing plan.

    1. For example after pressing the “Place order” button, the page just jumped back to homepage. Makes people wonder if the purchase was successful. Shouldn’t there be some sort of pop-up or redirect saying purchase successful/ thank you etc.?

    2. Also I think there should be a confirmation email after placing the order -> which can provide the bank info etc. Currently the bank info only shows on the checkout page, and once the order is placed it’s gone….

    Hope you could take these into development. Thank you.

    #28719

    CTHthemes
    Keymaster

    You can try these notification emails: http://prntscr.com/m4qbsk

    #28858

    samsun34567
    Participant

    Support Expired

    I understand.

    But it’s for when the order is completed -> after payment is received.

    What I’m trying to do is give the vendors some sort of notification that the order is placed. And instructions on how to make the payment.

    Or else it’ll be as I said, it’ll make people wonder is the order is successfully placed.

    #28992

    samsun34567
    Participant

    Support Expired

    Hey guys,

    Anything on this?

    Thanks!

    #29015

    CTHthemes
    Keymaster

    You can use this custom code

    
    add_action( 'citybook_addons_insert_order_after', function($order_id){
        if(is_numeric($order_id)&&(int)$order_id > 0){
            $order_post = get_post($order_id);
            if (null != $order_post){
                $listing_post = get_post(get_post_meta( $order_id, P_META_PREFIX.'listing_id', true ));
                if (null != $listing_post){
                    $listing_author_email = get_post_meta( $order_id, P_META_PREFIX.'email', true );
    
                    $subj_args = array(
                        'order_number' => $order_post->ID,
                        'order_date' => $order_post->post_date,
                    );
                    $email_subject = citybook_addons_process_email_template( 'Your order has been received', $subj_args);
                    $temp_args = array(
                        'author' => get_post_meta( $order_id, P_META_PREFIX.'display_name', true ),
                        'order_amount' => get_post_meta( $order_id, P_META_PREFIX.'amount', true ),
                        'order_currency' => get_post_meta( $order_id, P_META_PREFIX.'currency_code', true ),
                        'order_method' => citybook_addons_get_order_method_text(get_post_meta( $order_id, P_META_PREFIX.'payment_method', true )),
                        'order_title' => $order_post->post_title,
                        'order_number' => $order_post->ID,
                        'order_date' => $order_post->post_date,
                        'listing_title' => $listing_post->post_title,
                        
                    );
                    $email_template = citybook_addons_process_email_template('Hello {author}, Your order has been received. We will check and contact with you soon.', $temp_args);
                    
                    citybook_addons_do_wp_mail( $listing_author_email, $email_subject, $email_template);
                }
            }
        }
                
    
    } );
    
    
    #29035

    samsun34567
    Participant

    Support Expired

    Tried it, it’s not working….

    Below is my full function.php

    <?php
    /**
     * @package CityBook - Directory Listing WordPress Theme
     * @author CTHthemes - http://themeforest.net/user/cththemes
     * @date 17-04-2018
     * @since 1.0.0
     * @version 1.0.0
     * @copyright Copyright ( C ) 2014 cththemes.com . All rights reserved.
     * @license GNU General Public License version 3 or later; see LICENSE
     */
    // Your php code goes here
    function citybook_child_enqueue_styles() {
        $parent_style = 'citybook-style'; // This is 'citybook-style' for the Anakual theme.
        wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css', array('citybook-fonts', 'font-awesome', 'lightgallery', 'slick','citybook-plugins'), null );
        wp_enqueue_style( 'citybook-child-style',
            get_stylesheet_directory_uri() . '/style.css',
            array( $parent_style , 'citybook-color'),
            wp_get_theme()->get('Version')
        );
    }
    add_action( 'wp_enqueue_scripts', 'citybook_child_enqueue_styles' );
    
    function citybook_child_modify_footer(){
    	// if(is_page(551) || is_page(2170) || is_page(2172) || is_page(2185) || is_page(2193) || is_page(2196) || is_singular( 'listing' )){
    	if(!is_page(531) && !is_page(294) && !is_page(547) && !is_page(545) && !is_page(116) && !is_page(1624) && !is_page(920) && !is_page(553) && !is_page(697) && !is_page(2321) ){
    	?>
    	<!--section -->
    	<section class="gradient-bg">
    	    <div class="cirle-bg">
    	        <div class="bg" data-bg="<?php echo get_template_directory_uri();?>/assets/images/bg/circle.png"></div>
    	    </div>
    	    <div class="container">
    	        <div class="join-wrap fl-wrap">
    	        	<div class="row">
                        <div class="col-md-8">
                            <h3>Join our online community</h3>
                            <p>Grow your marketing and be happy with your online business</p>
                        </div>
                        <div class="col-md-4 text-center"><a href="#" class="join-wrap-btn logreg-modal-open">Sign Up <i class="fa fa-sign-in"></i></a></div>
                    </div>
    	        </div>
    	    </div>
    	</section>
    	<!-- section end -->
    	
    add_action( 'citybook_addons_insert_order_after', function($order_id){
        if(is_numeric($order_id)&&(int)$order_id > 0){
            $order_post = get_post($order_id);
            if (null != $order_post){
                $listing_post = get_post(get_post_meta( $order_id, P_META_PREFIX.'listing_id', true ));
                if (null != $listing_post){
                    $listing_author_email = get_post_meta( $order_id, P_META_PREFIX.'email', true );
    
                    $subj_args = array(
                        'order_number' => $order_post->ID,
                        'order_date' => $order_post->post_date,
                    );
                    $email_subject = citybook_addons_process_email_template( 'Your order has been received', $subj_args);
                    $temp_args = array(
                        'author' => get_post_meta( $order_id, P_META_PREFIX.'display_name', true ),
                        'order_amount' => get_post_meta( $order_id, P_META_PREFIX.'amount', true ),
                        'order_currency' => get_post_meta( $order_id, P_META_PREFIX.'currency_code', true ),
                        'order_method' => citybook_addons_get_order_method_text(get_post_meta( $order_id, P_META_PREFIX.'payment_method', true )),
                        'order_title' => $order_post->post_title,
                        'order_number' => $order_post->ID,
                        'order_date' => $order_post->post_date,
                        'listing_title' => $listing_post->post_title,
                        
                    );
                    $email_template = citybook_addons_process_email_template('Hello {author}, Your order has been received. We will check and contact with you soon.', $temp_args);
                    
                    citybook_addons_do_wp_mail( $listing_author_email, $email_subject, $email_template);
                }
            }
        }
                
    
    } );
    <?php
    	}
    }
    
    // add_action( 'citybook_footer_before', 'citybook_child_modify_footer');
    #29068

    CTHthemes
    Keymaster

    Try this instead:

    
    add_action( 'citybook_addons_insert_order_after', function($order_id, $listing_id, $plan_id){
        if(is_numeric($order_id)&&(int)$order_id > 0){
            $order_post = get_post($order_id);
            if (null != $order_post){
                $plan_post = get_post($plan_id);
                if (null != $plan_post){
                    $listing_author_email = get_post_meta( $order_id, P_META_PREFIX.'email', true );
    
                    $subj_args = array(
                        'order_number' => $order_post->ID,
                        'order_date' => $order_post->post_date,
                    );
                    $email_subject = citybook_addons_process_email_template( 'Your order has been received', $subj_args);
                    $temp_args = array(
                        'author' => get_post_meta( $order_id, P_META_PREFIX.'display_name', true ),
                        'order_amount' => get_post_meta( $order_id, P_META_PREFIX.'amount', true ),
                        'order_currency' => get_post_meta( $order_id, P_META_PREFIX.'currency_code', true ),
                        'order_method' => citybook_addons_get_order_method_text(get_post_meta( $order_id, P_META_PREFIX.'payment_method', true )),
                        'order_title' => $order_post->post_title,
                        'order_number' => $order_post->ID,
                        'order_date' => $order_post->post_date,
                        'listing_title' => $plan_post->post_title,
                        
                    );
                    $email_template = citybook_addons_process_email_template('Hello {author}, Your order has been received. We will check and contact with you soon.', $temp_args);
                    
                    citybook_addons_do_wp_mail( $listing_author_email, $email_subject, $email_template);
                }
            }
        }
                
    
    }, 10, 3 );
    
    
    #29611

    samsun34567
    Participant

    Support Expired

    Hi team,

    It’s still not working….

    Maybe it’ll be simpler to redirect to another page?

    That’ll work for me too.

    Thanks.

    #29642

    CTHthemes
    Keymaster

    Please update theme and its add-ons plugin to latest version then try this option: http://prntscr.com/mngw2g

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.

New featues: CityBook - Listing & Directory WordPress Theme version 2.0.0 was outUpdate now
+