Skip to content

Instantly share code, notes, and snippets.

@digisavvy
Created July 24, 2020 00:52
Show Gist options
  • Select an option

  • Save digisavvy/6c8ba14ccb858d90c4b4e850d818d831 to your computer and use it in GitHub Desktop.

Select an option

Save digisavvy/6c8ba14ccb858d90c4b4e850d818d831 to your computer and use it in GitHub Desktop.
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
do_action( 'cfw_thank_you_before_main_container', $order ); ?>
<main id="cfw" class="<?php echo cfw_main_container_classes( 'thank-you' ); ?>">
<?php do_action( 'cfw_thank_you_main_container_start', $order ); ?>
<?php if ( ! empty( $order ) ) : ?>
<div class="row">
<!-- Order Review -->
<div id="order_review" class="col-lg-7 cfw-rp" role="main">
hello world
<?php
/**
* @snippet WooCommerce Show Product Image @ Checkout Page
* @author Sandesh Jangam
* @donate $7 https://www.paypal.me/SandeshJangam/7
*/
add_filter( 'woocommerce_cart_item_name', 'ts_product_image_on_checkout', 10, 3 );
function ts_product_image_on_checkout( $name, $cart_item, $cart_item_key ) {
/* Return if not checkout page */
if ( ! is_checkout() ) {
return $name;
}
/* Get product object */
$_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );
/* Get product thumbnail */
$thumbnail = $_product->get_image();
/* Add wrapper to image and add some css */
$image = '<div class="ts-product-image" style="width: 52px; height: 45px; display: inline-block; padding-right: 7px; vertical-align: middle;">'
. $thumbnail .
'</div>';
/* Prepend image to name and return it */
return $image . $name;
}
?>
<?php do_action( 'cfw_thank_you_before_order_review' ); ?>
<?php do_action( 'cfw_thank_you_content', $order, $order_statuses, $show_downloads, $downloads ); ?>
<?php
/**
* Prevent thank you hooks from running when viewing order
*
* If we don't do this, tracking scripts will be distorted.
*/
if ( empty( $_GET['view'] ) ) :
?>
<?php do_action( 'woocommerce_thankyou_' . $order->get_payment_method(), $order->get_id() ); ?>
<?php do_action( 'woocommerce_thankyou', $order->get_id() ); ?>
<?php endif; ?>
<?php do_action( 'cfw_thank_you_after_order_review' ); ?>
</div>
<!-- Cart / Sidebar Column -->
<div id="cfw-cart-summary" class="col-lg-5" role="complementary">
<?php do_action( 'cfw_thank_you_cart_summary', $order ); ?>
</div>
</div>
<?php endif; ?>
<?php do_action( 'cfw_thank_you_main_container_end', $order ); ?>
</main>
<?php
do_action( 'cfw_thank_you_after_main_container', $order );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment