Changeset 2942948
- Timestamp:
- 07/25/2023 08:22:19 AM (3 years ago)
- Location:
- verge3d/trunk
- Files:
-
- 2 added
- 4 edited
-
elementor_widget.php (added)
-
js/woo_product.js (modified) (3 diffs)
-
js/woo_product_composite.js (added)
-
readme.txt (modified) (5 diffs)
-
verge3d.php (modified) (2 diffs)
-
woo_product.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
verge3d/trunk/js/woo_product.js
r2825703 r2942948 36 36 } 37 37 38 /** 39 * Get components of the composite product 40 */ 41 function v3d_woo_form_get_components(formData) { 42 if (window.v3d_woo_composite) { 43 const components = window.v3d_woo_composite.api.get_composite_configuration(); 44 for (const id in components) { 45 const component = components[id]; 46 for (const key in component) { 47 if (key == 'selection_meta') 48 for (let i = 0; i < component[key].length; i++) { 49 const meta_key = component[key][i].meta_key.toLowerCase(); 50 const meta_value = component[key][i].meta_value; 51 formData.append(`components[${id}][attributes][${meta_key}]`, meta_value); 52 } 53 else 54 formData.append(`components[${id}][${key}]`, component[key]); 55 } 56 } 57 } 58 } 59 38 60 function v3d_woo_get_product_info(callback) { 39 61 v3d_woo_product_info_cb = callback; … … 50 72 v3d_woo_form_get_variation_id(formData); 51 73 v3d_woo_form_get_attributes(formData); 74 v3d_woo_form_get_components(formData); 52 75 53 76 var req = new XMLHttpRequest(); … … 80 103 v3d_woo_request_product_info(); 81 104 } 105 window.v3d_on_product_update = v3d_on_product_update; 82 106 83 107 window.addEventListener('load', function() { -
verge3d/trunk/readme.txt
r2883285 r2942948 5 5 Tested up to: 6.0.1 6 6 Requires PHP: 7.0 7 Stable tag: 4. 3.07 Stable tag: 4.4.0 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 14 14 Verge3D is the most artist-friendly toolkit for creating interactive WebGL-based and immersive AR/VR experiences. Among the features of this framework are top-class graphics, integration with your favorite modeling suites, efficient web-friendly format for loading assets, seamless integration with WordPress and WooCommerce plugin. Interactivity is enabled with Puzzles, an intuitive and easy-to-learn visual scripting environment. 15 15 16 Verge3D can be used to create product configurators, 3D presentations, online stores, e-learning apps, 3D portfolios, browser games and more.16 Verge3D can be used to create product configurators, 3D presentations, online stores, e-learning apps, 3D portfolios, browser games, and more. 17 17 18 18 You can try this plugin live using this [sandbox website](https://sandbox.soft8soft.com/) or follow the quick-start guide [here](https://www.soft8soft.com/making-3d-product-configurator-for-woocommerce/). … … 32 32 = Use familiar tools = 33 33 34 We designed Verge3D to be closely integrated with your favorite tools. You can create your 3D content in 3ds Max or Blender, and export straight to a web page. You can also preview your scene in the browser using the Sneak Peek feature.34 We designed Verge3D to be closely integrated with your favorite tools. You can create your 3D content in Blender, 3ds Max, or Maya, and export straight to a web page. You can also preview your scene in the browser using the Sneak Peek feature. 35 35 36 36 But, of course, aside from the 3D part, there is also web! With Verge3D, you can completely forget about building HTML/CSS layouts and JavaScript coding by … … 62 62 1. 3D product customizer with WooCommerce integration 63 63 2. Scooter - interactive configurator with 1000000+ combinations 64 3. Verge3D features direct export from Blender or 3ds Max64 3. Verge3D features direct export from Blender, 3ds Max, or Maya 65 65 4. Used by NASA and other companies and organizations throughout the world 66 66 5. Interactive WebGL-based online shop … … 69 69 == Changelog == 70 70 71 = 4.4 = 72 * Verge3D widget for Elementor. 73 * Support WooCommerce Composite Products extension. 74 75 = 4.3 = 76 * Verge3D 4.3 version bump. 77 71 78 = 4.2 = 72 * Support 3D items in WooCommerce product gallery 73 * Fix i dentation in Gutenberg editor74 * Fix app layout on mobiles 79 * Support 3D items in WooCommerce product gallery. 80 * Fix indentation in Gutenberg editor. 81 * Fix app layout on mobiles. 75 82 76 83 = 4.1 = -
verge3d/trunk/verge3d.php
r2883285 r2942948 4 4 Plugin URI: https://www.soft8soft.com/verge3d 5 5 Description: Verge3D is the most artist-friendly toolkit for creating interactive web-based experiences. It can be used to create product configurators, 3D presentations, online stores, e-learning apps, 3D portfolios, browser games and more. 6 Version: 4. 3.06 Version: 4.4.0 7 7 Author: Soft8Soft LLC 8 8 Author URI: https://www.soft8soft.com … … 1354 1354 add_action('admin_enqueue_scripts', 'load_wp_media_files'); 1355 1355 1356 function v3d_register_elementor_widget($widgets_manager) { 1357 require_once(__DIR__ . '/elementor_widget.php'); 1358 $widgets_manager->register(new \V3D_Elementor_Widget()); 1359 } 1360 add_action('elementor/widgets/register', 'v3d_register_elementor_widget'); 1361 1362 1363 /** 1364 * Global utility functions 1365 **/ 1356 1366 1357 1367 function v3d_inline_custom_styles() { -
verge3d/trunk/woo_product.php
r2825703 r2942948 3 3 function v3d_load_woo_scripts() { 4 4 global $post; 5 wp_enqueue_script('v3d_ admin', plugin_dir_url( __FILE__ ) . 'js/woo_product.js');5 wp_enqueue_script('v3d_woo_product', plugin_dir_url( __FILE__ ) . 'js/woo_product.js'); 6 6 7 7 $switch_on_update = get_post_meta(get_the_ID(), 'v3d_app_show_gallery', true) && 8 8 get_post_meta(get_the_ID(), 'v3d_app_switch_on_update', true); 9 9 10 wp_localize_script('v3d_ admin', 'v3d_ajax_object',10 wp_localize_script('v3d_woo_product', 'v3d_ajax_object', 11 11 array( 12 12 'ajax_url' => admin_url('admin-ajax.php'), 13 13 'switch_on_update' => $switch_on_update 14 14 )); 15 16 15 } 17 16 add_action('wp_enqueue_scripts', 'v3d_load_woo_scripts'); 17 18 19 function v3d_bootstap_woo_product_composite($dependencies) { 20 wp_register_script('v3d_woo_product_composite', plugin_dir_url(__FILE__) . 'js/woo_product_composite.js'); 21 $dependencies[] = 'v3d_woo_product_composite'; 22 return $dependencies; 23 } 24 25 function v3d_plugins_loaded() { 26 global $woocommerce_composite_products; 27 add_filter('woocommerce_composite_script_dependencies', 'v3d_bootstap_woo_product_composite'); 28 } 29 add_action('plugins_loaded', 'v3d_plugins_loaded'); 18 30 19 31 … … 22 34 function v3d_product_tab($tabs) { 23 35 $tabs['verge3d'] = array( 24 'label' => __('Verge3D', 'verge3d'),36 'label' => __('Verge3D', 'verge3d'), 25 37 'target' => 'v3d_product_options', 26 38 'class' => array('show_if_verge3d'), … … 224 236 225 237 $response['weight'] = floatval($product->get_weight()); 226 227 238 $response['length'] = floatval($product->get_length()); 228 239 $response['width'] = floatval($product->get_width()); … … 250 261 if (!empty($variation->get_weight())) 251 262 $response['weight'] = floatval($variation->get_weight()); 252 253 263 if (!empty($variation->get_length())) 254 264 $response['length'] = floatval($variation->get_length()); … … 291 301 } 292 302 303 } else if ($product->is_type('composite')) { 304 305 $response['components'] = array(); 306 307 if (!empty($_REQUEST['components'])) { 308 foreach ($_REQUEST['components'] as $comp_id => $comp) { 309 310 $comp_response = array(); 311 312 $comp_response['title'] = $comp['title']; 313 $comp_response['id'] = $comp_id; 314 315 $comp_response['type'] = $comp['product_type']; 316 $comp_response['quantity'] = intval($comp['quantity']); 317 318 $child = wc_get_product($comp['product_id']); 319 320 if (!empty($child)) { 321 $comp_response['name'] = $comp['selection_title']; 322 $comp_response['sku'] = $child->get_sku(); 323 $comp_response['weight'] = floatval($child->get_weight()); 324 $comp_response['length'] = floatval($child->get_length()); 325 $comp_response['width'] = floatval($child->get_width()); 326 $comp_response['height'] = floatval($child->get_height()); 327 $comp_response['attributes'] = v3d_product_get_attributes($child); 328 } else { 329 $comp_response['name'] = ''; 330 $comp_response['sku'] = ''; 331 $comp_response['weight'] = 0; 332 $comp_response['length'] = 0; 333 $comp_response['width'] = 0; 334 $comp_response['height'] = 0; 335 $comp_response['attributes'] = []; 336 } 337 338 if ($comp['product_type'] == 'variable') { 339 if (!empty($comp['variation_id'])) { 340 $variation = wc_get_product($comp['variation_id']); 341 342 $comp_response['name'] = $variation->get_name(); 343 344 if (!empty($variation->get_sku())) 345 $comp_response['sku'] = $variation->get_sku(); 346 347 if (!empty($variation->get_weight())) 348 $comp_response['weight'] = floatval($variation->get_weight()); 349 if (!empty($variation->get_length())) 350 $comp_response['length'] = floatval($variation->get_length()); 351 if (!empty($variation->get_width())) 352 $comp_response['width'] = floatval($variation->get_width()); 353 if (!empty($variation->get_height())) 354 $comp_response['height'] = floatval($variation->get_height()); 355 356 foreach ($comp['attributes'] as $attr_key => $attr_value) { 357 $comp_response['attributes'][$attr_key] = $attr_value; 358 } 359 } else { 360 // nothing selected, reset all attributes to empty strings 361 foreach ($comp_response['attributes'] as $attr_key => $attr_value) { 362 $comp_response['attributes'][$attr_key] = ''; 363 } 364 } 365 } 366 367 // make empty array an object to be properly handled by JSON encode 368 if (empty($comp_response['attributes'])) 369 $comp_response['attributes'] = (object)array(); 370 371 array_push($response['components'], $comp_response); 372 } 373 } 293 374 } 375 376 // make empty array an object to be properly handled by JSON encode 377 if (empty($response['attributes'])) 378 $response['attributes'] = (object)array(); 294 379 295 380 } else { … … 302 387 add_action('wp_ajax_v3d_woo_get_product_info', 'v3d_get_product_info'); 303 388 add_action('wp_ajax_nopriv_v3d_woo_get_product_info', 'v3d_get_product_info'); 389
Note: See TracChangeset
for help on using the changeset viewer.