', esc_attr( $article_id ) ); echo apply_filters( 'sfw/orderform/opening_tag', $html ); // @todo codex do_action( 'sfw/orderform/before', $article_id ); } /** * print closing orderform tags * * @since 1.0.0 */ function sfw_orderform_close( ) { sfw_orderform_hidden_fields(); // @todo codex do_action( 'sfw/orderform/after' ); $GLOBALS['sfw-in-orderform'] = false; echo ''; } /** * Prints add to basket button * * @since 1.0.0 */ function sfw_add_to_cart_button() { printf( '%s', __( 'Add to Cart', 'apparelcuts-spreadshirt' ) ); } /** * echo some required hidden fields for basket Operations * * @todo add is editable logic * @since 1.0.0 */ function sfw_orderform_hidden_fields(){ // the following two are for future compatibility ?> ', sfw_get_article_appearance_id() ); return apply_filters( 'sfw/orderform/appearance', $code, sfw_get_article_appearance_id() ); } /** * Print Appearance Field * * @return [type] * @since 1.0.1 */ function sfw_orderform_appearance_field() { echo sfw_get_orderform_appearance_field(); } /** * Retrieve Size Field * * @since 1.0.1 */ function sfw_get_orderform_size_field() { $code = ''; while( sfw_have_sizes() ): $code = sprintf( '', esc_attr( sfw_get_size_id() ) ); endwhile; return apply_filters( 'sfw/orderform/size', $code, sfw_get_article_appearance_id() ); } /** * Print Size Field * * @return [type] * @since 1.0.1 */ function sfw_orderform_size_field() { echo sfw_get_orderform_size_field(); } /** * Retrieve the default quantity * * @return int * @since 1.0.0 */ function sfw_get_orderform_defaut_quantity() { return apply_filters('sfw/orderform/quantity', 1 ); } /** * Echoes the default quantity * * @since 1.0.0 */ function sfw_orderform_defaut_quantity() { echo sfw_get_orderform_defaut_quantity(); } /** * Retrieve the Continue Shopping Link * * @return string * @since 1.0.0 */ function sfw_get_continue_shopping_url() { return apply_filters( 'sfw/continue_shopping_url', site_url() ); } /** * Retrieve a product stockstate message tag * * @param string $text * @return string * @since 1.0.0 */ function sfw_get_stockstate_message( $text = false ) { $text = $text ?: __( 'Sorry, this product is currently unavailable :(', 'apparelcuts-spreadshirt' ); $text = apply_filters( 'sfw/sfw_product_unavailable_message', $text ); return sprintf( '%s', $text ); } /** * Echo a product stockstate message tag * * @param string $text * @return string * @since 1.0.0 */ function sfw_stockstate_message( $text = false ) { echo sfw_get_stockstate_message( $text ); } /** * Prints product uavailable message * * @param string $text * @since 1.0.0 */ function sfw_product_unavailable_message( $text = false ) { echo sfw_get_product_unavailable_message( $text ); } //add_action( 'sfw/theme/orderform/before_price', 'sfw_product_unavailable_message' ); /** * Retrieve product customize button * * @param string $text * @return string * @since 1.0.0 */ function sfw_get_product_customize_button( $text = false ) { $text = $text ?: __( 'Customize', 'apparelcuts-spreadshirt' ); $text = apply_filters( 'sfw/sfw_product_customize_button', '' . $text ); return sprintf( '%s', sfw_get_article_customize_link(), $text ); } /** * Echoes product customize button * * @param string $text * @since 1.0.0 */ function sfw_product_customize_button( $text = false ) { echo sfw_get_product_customize_button( $text ); } add_action( 'sfw/theme/orderform/actions', 'sfw_product_customize_button' );