Posts by ChapterThemes

579 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Sold between 10 000 and 50 000 dollars
ChapterThemes says

I think what you need is a combination of adding custom checkout fields and the use of javascript/jQuery to show/hide that field.

Now, WooCommerce has hooks to for example add your own shipping fields or adress fields. One hook is for example: woocommerce_checkout_fields.

Which can be used something like this:

add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );

function custom_override_checkout_fields( $fields ) {
    $fields['billing']['extrafield-id'] = array(

        'label'     => __('Extra field', 'woocommerce'),
        'placeholder'   => _x('Extra field', 'placeholder', 'woocommerce'),
        'required'  => false,
        'class'     => array('form-row-wide'),
        'clear'     => true
    );

    return $fields;
}

Then there’re also hooks to save the extra fields with the orders, for example: woocommerce_checkout_update_order_meta.

Something like:

add_action('woocommerce_checkout_update_order_meta', 'my_custom_checkout_field_update_order_meta');

function my_custom_checkout_field_update_order_meta( $order_id ) {
    if ($_POST['extrafield-id']) update_post_meta( $order_id, 'Extra field', esc_attr($_POST['extrafield-id']));
}

Then, to show/hide your extra fields – hide them by default with CSS, and create a jQuery script which shows the extra fields when the right shipping method is selected.

Note that these may not be the hooks you need, but i’m sure there are hooks to add the extra fields to the appropiate section.

Then i think the solution is javascript to show and hide on a certain payment/shipping select method.

good luck!

579 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Sold between 10 000 and 50 000 dollars
ChapterThemes says

Not going to be much help here, but as for checking that woo commerce exists, wouldn’t it be better to check for the class?
if( class_exists('Woocommerce') )

He’s actually doing it as woocommerce suggests:

http://docs.woothemes.com/document/create-a-plugin/
579 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Sold between 10 000 and 50 000 dollars
ChapterThemes says

Is this possible?

I see the register cpt and add_object_page functions etc. only adding the class right when ‘dashicons-’ is part of the icon parameter.

Is it possible to use other or add custom fonts to use?

579 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Sold between 10 000 and 50 000 dollars
ChapterThemes says

The most annoying thing about like 9 out of 10 of such themes is that they all scroll like shit.

The scrolling experience is just SO bad it makes me wanna leave the site immediatly.

Stupid scrollbar customization makes it even worse too..

579 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Sold between 10 000 and 50 000 dollars
ChapterThemes says

I love it! Really looks great.

For sure you have to get used to it but that’s always the case.

I like it very much.

579 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Sold between 10 000 and 50 000 dollars
ChapterThemes says

I think the reviewers do look at the demo you’ve set up? Don’t they?

579 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Sold between 10 000 and 50 000 dollars
ChapterThemes says

I also have the same question about custom post types which they also need to be inside a plugin. Should I move my single-custom-post-type.php files also inside the plugin along with all of the styling?

Template files should be in the theme

579 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Sold between 10 000 and 50 000 dollars
ChapterThemes says

winter depression ;)

579 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Sold between 10 000 and 50 000 dollars
ChapterThemes says

superbe!

so this is actually a new filter since 3.7, cool!

579 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Sold between 10 000 and 50 000 dollars
ChapterThemes says

Use one like jrod_ so you can re-use code without having to change the naming every time.

by
by
by
by
by
by