Changeset 2908671
- Timestamp:
- 05/05/2023 06:40:15 PM (3 years ago)
- Location:
- pushalert-web-push-notifications/trunk
- Files:
-
- 2 edited
-
pushalert.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pushalert-web-push-notifications/trunk/pushalert.php
r2881114 r2908671 6 6 * Author: PushAlert 7 7 * Author URI: https://pushalert.co 8 * Version: 2. 7.08 * Version: 2.8.0 9 9 */ 10 10 … … 1032 1032 } 1033 1033 1034 if(get_option('pushalert_large_image', 0)){ 1035 $user_info['image'] = pushalert_get_product_image_url(); 1036 } 1037 1034 1038 $user_info['total_items'] = (!$total_items ? sizeof(WC()->cart->get_cart()) : $total_items); 1035 1039 $pa_check_cookie = filter_input(INPUT_COOKIE, 'pushalert_'.pa_encrypt($curr_user->ID, get_option('pushalert_encrypt_key'))); … … 1045 1049 } 1046 1050 1051 } 1052 1053 function pushalert_get_product_image_url(){ 1054 $images = []; 1055 if (!WC()->cart->is_empty()) { 1056 foreach (WC()->cart->get_cart() as $cart_item) { 1057 $_product = $cart_item['data']; 1058 //$link = $_product->get_permalink(); 1059 //$title = $_product->get_title(); 1060 //$price = $_product->get_price(); 1061 $image_id = $_product->get_image_id(); 1062 1063 $image = wp_get_attachment_image_src($image_id, 'single-post-thumbnail'); 1064 if (!$image) { 1065 $image = wp_get_attachment_image_url($image_id, 'full'); 1066 } else { 1067 $image = $image[0]; 1068 } 1069 $images[] = $image; 1070 } 1071 } 1072 1073 if (count($images) > 0) { 1074 return $images[array_rand($images)]; 1075 } else { 1076 return ""; 1077 } 1047 1078 } 1048 1079 -
pushalert-web-push-notifications/trunk/readme.txt
r2893516 r2908671 5 5 Requires at least: 2.7 6 6 Tested up to: 6.2 7 Stable tag: 2. 7.07 Stable tag: 2.8.0 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 84 84 85 85 == Changelog == 86 87 = 2.8.0 = 88 * Featured image use extended to WooCommerce abandoned cart notifications. Now an image of the product will be shown as large image in the notification. 86 89 87 90 = 2.7.0 =
Note: See TracChangeset
for help on using the changeset viewer.