Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action('wp_footer','wapf_custom_addcart');
- function wapf_custom_addcart() {
- ?>
- <script>
- jQuery(document).on('adding_to_cart',function(e,d,a){
- for(var i = 0;i<a.length;i++) {
- if(a[i].name && a[i].name.indexOf('wapf[') > -1)
- a.splice(i,1);
- }
- var o = jQuery('.wapf-wrapper :input').serializeArray();
- o.forEach(function(ob){
- a.push({name:ob.name,value: ob.value});
- });
- });
- </script>
- <?php
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement