| | |
| | | <div> |
| | | <h4>%s — %s</h4> |
| | | %s |
| | | </div>', //Note: we had 3 %s%s%s before the last </div> last time. This was to add optional ingredients or preparation time duration, not default in WooCommerce |
| | | </div><a href="?add-to-cart=%d&variation_id=%d" |
| | | data-quantity="1" |
| | | data-product_id="%d" |
| | | data-variation_id="%d" |
| | | class="add_to_cart_button ajax_add_to_cart add-to-cart"> |
| | | %s |
| | | <span>Add to Cart</span> |
| | | </a>', //Note: we had 3 %s%s%s before the last </div> last time. This was to add optional ingredients or preparation time duration, not default in WooCommerce |
| | | $row['title'], |
| | | jvbCurrency($row['price']), |
| | | empty($row['description']) ? '' : wpautop($row['description']), |
| | | $ID, |
| | | $row['id'], |
| | | $ID, |
| | | $row['id'], |
| | | jvbIcon('plus-square') |
| | | ); |
| | | |
| | | $out .= Form::render( |
| | | $row['id'], |
| | | '', |
| | | [ |
| | | 'type' => 'quantity', |
| | | 'label' => $row['title'], |
| | | 'min' => 0, |
| | | 'max' => 30, |
| | | 'data' => [ |
| | | 'price' => $row['price'], |
| | | 'id' => $row['id'], |
| | | 'sku' => $row['sku'], |
| | | 'name' => $row['title'], |
| | | 'add-to-cart' => '' |
| | | ], |
| | | 'add' => 'Add 1 '.$row['title'].' to cart', |
| | | 'remove' => 'Remove 1 '.$row['title']. ' from cart', |
| | | ] |
| | | ); |
| | | // $out .= Form::render( |
| | | // $row['id'], |
| | | // '', |
| | | // [ |
| | | // 'type' => 'quantity', |
| | | // 'label' => $row['title'], |
| | | // 'min' => 0, |
| | | // 'max' => 30, |
| | | // 'data' => [ |
| | | // 'price' => $row['price'], |
| | | // 'id' => $row['id'], |
| | | // 'sku' => $row['sku'], |
| | | // 'name' => $row['title'], |
| | | // 'add-to-cart' => '' |
| | | // ], |
| | | // 'add' => 'Add 1 '.$row['title'].' to cart', |
| | | // 'remove' => 'Remove 1 '.$row['title']. ' from cart', |
| | | // ] |
| | | // ); |
| | | $out .= '</div>'; |
| | | } |
| | | } else { |
| | | $out .= Form::render( |
| | | $out .= sprintf( |
| | | '<a href="?add-to-cart=%d" |
| | | data-quantity="1" |
| | | data-product_id="%d" |
| | | class="add_to_cart_button ajax_add_to_cart add-to-cart"> |
| | | %s |
| | | <span>Add to Cart</span> |
| | | </a>', |
| | | $ID, |
| | | '', |
| | | [ |
| | | 'type' => 'quantity', |
| | | 'label' => 'Add to Order', |
| | | 'min' => 0, |
| | | 'max' => 30, |
| | | 'step' => 1, |
| | | 'data' => [ |
| | | 'price' => $fields['_price'], |
| | | 'id' => $ID, |
| | | 'name' => $fields['post_title'], |
| | | 'step' => 1, |
| | | 'add-to-cart' => '', |
| | | ], |
| | | 'add' => 'Add 1 '.$fields['post_title'].' to cart', |
| | | 'remove' => 'Remove 1 '.$fields['title']. ' from cart', |
| | | ] |
| | | $ID, |
| | | jvbIcon('plus-square') |
| | | ); |
| | | // $out .= Form::render( |
| | | // $ID, |
| | | // '', |
| | | // [ |
| | | // 'type' => 'quantity', |
| | | // 'label' => 'Add to Order', |
| | | // 'min' => 0, |
| | | // 'max' => 30, |
| | | // 'step' => 1, |
| | | // 'data' => [ |
| | | // 'price' => $fields['_price'], |
| | | // 'id' => $ID, |
| | | // 'name' => $fields['post_title'], |
| | | // 'step' => 1, |
| | | // 'add-to-cart' => '', |
| | | // ], |
| | | // 'add' => 'Add 1 '.$fields['post_title'].' to cart', |
| | | // 'remove' => 'Remove 1 '.$fields['title']. ' from cart', |
| | | // ] |
| | | // ); |
| | | } |
| | | |
| | | $out .= '</div></div>'; |