menu.toggle();
});
-
// Disable clicks on top level menu links that have sub-menus
$(document).on('click', '.navigation .menu-item-has-children > a', function(event) {
event.stopPropagation();
window.addEventListener('scroll', throttle(headerTransition, 100)); // Throttle 100ms for scroll event
+ //
+ if ( $('.wps_sfw_check_simple_cart_subscription_purchase').length > 0 ) {
+ $('.wps_sfw_check_simple_cart_subscription_purchase:not(:checked)').prop('checked', false);
+ } else {
+ setTimeout(() => {
+ $('.wps_sfw_check_simple_cart_subscription_purchase:not(:checked)').prop('checked', false);
+ }, 100);
+ }
+
+ //
+ $(document).on("change", ".woocommerce-cart-form", function(){
+ const isApp = window.location.search.substring(1).split("&").includes("app=true")
+ if(isApp) $("button[name=update_cart]").trigger("click")
+ })
},
finalize() {
// JavaScript to be fired on all pages, after page specific JS is fired
<th class="product-name"><?php esc_html_e( 'Product', 'woocommerce' ); ?></th>
<th class="product-price"><?php esc_html_e( 'Price', 'woocommerce' ); ?></th>
<th class="product-quantity"><?php esc_html_e( 'Quantity', 'woocommerce' ); ?></th>
- <th class="product-frequency"></th>
+ <th class="product-frequency">Fréquence</th>
<th class="product-subtotal"><?php esc_html_e( 'Subtotal', 'woocommerce' ); ?></th>
</tr>
</thead>
<?php
if ( wps_sfw_check_product_is_subscription( $cart_item['data'] )) {
$wps_skip_creating_subscription = apply_filters( 'wps_skip_creating_subscription', true, $cart_item );
- if ( $wps_skip_creating_subscription ) {?>
+ ?>
<td class="product-frequency" data-title="<?php esc_attr_e( 'Frequency', 'woocommerce' ); ?>">
- <?php do_action('woocommerce_after_add_to_cart_quantity', $product_id); ?>
+ <?php do_action('woocommerce_after_add_to_cart_quantity', $wps_skip_creating_subscription, $product_id); ?>
</td>
- <?php }
+ <?php
}
?>
<td class="product-subtotal" data-title="<?php esc_attr_e( 'Subtotal', 'woocommerce' ); ?>">
?>
<?php do_action( 'woocommerce_cart_contents' ); ?>
-
- <tr>
+ <tr <?php echo (filter_input(INPUT_GET, 'app', FILTER_SANITIZE_STRING) === "true" ? "style=display:none;" : "") ?>>
<td colspan="7" class="actions">
<?php if ( wc_coupons_enabled() ) { ?>
<?php wp_nonce_field( 'woocommerce-cart', 'woocommerce-cart-nonce' ); ?>
</td>
</tr>
-
+ <?php
+ ?>
<?php do_action( 'woocommerce_after_cart_contents' ); ?>
</tbody>
</table>