screens
2 years ago
checkout-review-order-config.php
3 years ago
checkout-review-order.php
3 years ago
checkout-review-order-config.php
52 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Elementor; |
| 4 | |
| 5 | defined('ABSPATH') || exit; |
| 6 | |
| 7 | class ShopEngine_Checkout_Review_Order_Config extends \ShopEngine\Base\Widget_Config { |
| 8 | |
| 9 | public function get_name() { |
| 10 | return 'checkout-review-order'; |
| 11 | } |
| 12 | |
| 13 | |
| 14 | public function get_title() { |
| 15 | return esc_html__('Checkout Order Review', 'shopengine'); |
| 16 | } |
| 17 | |
| 18 | |
| 19 | public function get_icon() { |
| 20 | return 'shopengine-widget-icon shopengine-icon-checkout_review_order'; |
| 21 | } |
| 22 | |
| 23 | |
| 24 | public function get_categories() { |
| 25 | return ['shopengine-checkout']; |
| 26 | } |
| 27 | |
| 28 | |
| 29 | public function get_keywords() { |
| 30 | return ['checkout', 'shopengine', 'checkout review orders', 'review orders']; |
| 31 | } |
| 32 | |
| 33 | |
| 34 | public function get_template_territory() { |
| 35 | return ['checkout', 'quick_checkout']; |
| 36 | } |
| 37 | |
| 38 | public static function add_product_thumbnail( $cart_item ) { |
| 39 | |
| 40 | if(!empty($cart_item['product_id'])) { |
| 41 | $product = wc_get_product( intval($cart_item['product_id']) ); |
| 42 | $product_id = !empty( $cart_item['variation_id'] ) ? intval($cart_item['variation_id']) : $product->get_id(); |
| 43 | $attachment = wp_get_attachment_image( get_post_thumbnail_id( $product_id ), 'single-post-thumbnail' ); |
| 44 | |
| 45 | if(empty($attachment)) { |
| 46 | $attachment = wp_get_attachment_image( $product->get_image_id(), 'full' ); |
| 47 | } |
| 48 | shopengine_content_render($attachment); |
| 49 | } |
| 50 | } |
| 51 | } |
| 52 |