Changeset 2173650
- Timestamp:
- 10/15/2019 11:53:16 AM (6 years ago)
- Location:
- wootomation/trunk
- Files:
-
- 3 edited
-
includes/class-sales.php (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
-
wootomation.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wootomation/trunk/includes/class-sales.php
r2172583 r2173650 94 94 public static function get_most_frequent($data){ 95 95 96 if( !isset( $data ) ) return false;96 if( empty( $data ) ) return false; 97 97 98 98 // combine all arrays -
wootomation/trunk/readme.txt
r2172588 r2173650 1 === Other people also bought===2 Tags: woocommerce,ecommerce,automation,a i,ml1 === Wootomation - Machine Learning AI === 2 Tags: woocommerce,ecommerce,automation,artificial-intelligence,machine-learning,ai,ml 3 3 Requires at least: 4.9 4 4 Tested up to: 5.2.3 … … 7 7 License URI: https://www.gnu.org/licenses/gpl-2.0.html 8 8 9 Wootomation allows to add " Other peoplealso bought..." feature to your WooCommerce site. Increase your sales with the help of Machine Learning AI.9 Wootomation allows to add "People who bought these, also bought..." feature to your WooCommerce site. Increase your sales with the help of Machine Learning AI. 10 10 11 11 == Description == … … 24 24 25 25 == Frequently Asked Questions == 26 How does it work? 26 = How does it work? = 27 27 28 28 The machine-learning artificial intelligence analyses all the sales in a smart way, it learns from them, and then is able to predict the most relevant products to your customers, thus increasing sales. With each purchase going forward, it keeps learning and gets better and better. 29 30 == Screenshots == 31 32 1. Storefront example 33 2. Storefront example -
wootomation/trunk/wootomation.php
r2172583 r2173650 7 7 * Author: Dragos Micu 8 8 * Author URI: https://www.dragosmicu.co.uk/ 9 * Text Domain: Wootomation 10 * WC tested up to 3.7.1 9 11 */ 10 12 … … 162 164 $suggestions = Wootomation_AI::predict($associator, $products_in_cart); 163 165 164 $sorted_data = Wootomation_Sales::get_most_frequent($suggestions); 165 $number_of_suggestions = count( $sorted_data ); 166 if( $suggestions ){ 167 $sorted_data = Wootomation_Sales::get_most_frequent($suggestions); 168 $number_of_suggestions = count( $sorted_data ); 169 } else { 170 $sorted_data = array(); 171 $number_of_suggestions = 0; 172 } 166 173 167 174 if( $number_of_suggestions < 3 ){ 168 175 $needed_sugestions = 3 - $number_of_suggestions; 176 if( $needed_sugestions > count($products_in_cart) ){ 177 $needed_sugestions = count($products_in_cart); 178 } 169 179 170 180 for ($i=0; $i < $needed_sugestions; $i++) { … … 174 184 $secondary_data = Wootomation_Sales::get_most_frequent($suggestions); 175 185 176 foreach ($secondary_data as $each_data) { 177 if( !in_array($each_data, $products_in_cart) ){ 178 array_push($sorted_data, $each_data); 186 if( $secondary_data ){ 187 foreach ($secondary_data as $each_data) { 188 if( !in_array($each_data, $products_in_cart) ){ 189 array_push($sorted_data, $each_data); 190 } 179 191 } 180 192 }
Note: See TracChangeset
for help on using the changeset viewer.