wc

Create WooCommerce Product jQuery(document).ready(function($){ $(‘#field_frm_woo_sale_start’).change(function(){ frmCopyDateToEpochField( ‘#field_frm_woo_sale_start’, ‘#field_frm_woo_sale_start_epoch’ ); frmSetPrice(); }); $(‘#field_frm_woo_sale_end’).change(function(){ frmCopyDateToEpochField( ‘#field_frm_woo_sale_end’, ‘#field_frm_woo_sale_end_epoch’ ); frmSetPrice(); }); $(document).on(‘change’, ‘#field_frm_regular_price, #field_frm_sale_price’, frmSetPrice); function frmCopyDateToEpochField( dateId, epochId ) { var $dateField = $(dateId); if ( typeof $dateField.datepicker !== ‘undefined’ && $.isFunction( $dateField.datepicker ) ) { var date = new Date( $dateField.datepicker( ‘getDate’ ) ); var epoch = date.getTime() / 1000 – date.getTimezoneOffset() * 60 + 21600; $(epochId).val(epoch); } } function frmSetPrice() { var salePrice = $(“#field_frm_sale_price”).val(); var regularPrice = $(“#field_frm_regular_price”).val(); var date = new Date(); var now = Math.round(date.getTime() / 1000); var saleStart = parseInt( $(‘#field_frm_woo_sale_start_epoch’).val() ); var saleEnd = parseInt( $(‘#field_frm_woo_sale_end_epoch’).val() ); if ( salePrice !== ” && ! isNaN(saleStart) && ! isNaN(saleEnd) && saleStart <= now && now <= saleEnd ) { $(“#field_frm_price”).val(salePrice); } else { $(“#field_frm_price”).val(regularPrice); } } });
  • Vendor Information
  • Basic Product Information
  • Product Price
    • Additional Information

    Vendor Information

    Note: If you provide your last name, users will be able to see your full name. If you do not provide your last name, they will only see your first name.

    This is the form of contact that others will use to get in touch with you about your product
    Add an email so customers can contact you about your item.
    Add a phone number so customers can contact you more easily.
    Scroll to Top