mardi 28 juin 2016

Auto text woocommerce_short_description hook

I am trying to create an automatic text in the description of the WooCommerce articles and put "article only available in the store."

I thought about putting it inside a function like this:

add_filter ('woocommerce_short_description', 'in_single_product', 10, 2);

function in_single_product () {
    echo '<p> my-text-here </ p>';
}

But the text does not appear in the front-end. It only appears if I put the text on the back-end.

Does anyone know why this happens?



via Chebli Mohamed

How to change the content of wordpress lostpassword mail?

how to edit the content of wordpress lostpassword mail by myself. please tell me which file I should change or how to do this? Thank you very much. Here is the content now:

有人申请了修改密码: 站点:www..com 用户名:

点击http:http://ift.tt/294msUK



via Chebli Mohamed

Externally accessing social account URLs set in Yoast SEO

The Yoast SEO plugin has a settings page where you can specify the URLs of your social accounts with facebook, twitter, etc.

Is it possible to access these values outside of Yoast, for instance if I was piecing together a selection of social links in the footer of the website I was building? or wanting to add them to a theme options page within the site admin?

I want to avoid having multiple areas to add / update social accounts within the wordpress admin, so it would be useful if I could get to these values that will already be set up by the client.



via Chebli Mohamed

Set cart permalink when cart is not empty

I have no cart link set in the backend of WooCommerce. Instead I have the cart redirected to the checkout page. This works fine, however now I end up with empty urls. When I add a product to the cart I get the message 'successfully added to the cart, see the cart here'. 'See the cart here' is linked to wc_get_page_permalink( 'cart' ), but this is not set.

Is it possible through a function to set the wc_get_page_permalink( 'cart' ) ONLY when items are in the cart?

I tried something like:

function custom_continue_shopping_redirect_url ( $product_id ) {
    $url = "http://www.url.com"; // Add your link here
    return $url;
}
add_filter('wc_add_to_cart_message', 'custom_continue_shopping_redirect_url');

But that is obviously replacing the whole add to cart message.

Thanks.



via Chebli Mohamed

how to link category tags

I want to link categories to their own pages. so I mean when I click to 'Hotels' it should open the page which is Category/Hotels

enter image description here

this is the current code

<select name="category">
  <option value="">Any Category</option>
  <option value="clubs">Clubs</option></a>
  <option value="hotels">Hotels</option>
  <option value="pubbar">Pub&amp;Bar</option>
  <option value="restaurants">Restaurants</option>
</select>

lets say I want to link like that

  <option value="http://ift.tt/290vO28; Clubs </option>
  <option value="http://ift.tt/297z8MK; Hotels </option>
.. and so on

but when I do, its directing to this page:

http://ift.tt/290vQXS



via Chebli Mohamed

WP Custom Post Type Backend View

I have created a Custom Post Type with the Custom Post Type UI plugin.

I have added a number of custom fields which are connected to this custom post type.

I want to create a Backend View for the custom post type where the user can see the post without the ability to Edit the post.

I need help (links to tutorials or relevant WP documentation) on the following issues:

  • Overriding the 'View' button shown for every entry to point to the 'Backend View' page
  • Creating the 'Backend View'


via Chebli Mohamed

WooCommerce: Account Password Field in Checkout page

My main goal is to change the "create an account" checkout to register the email as a username. The easy way I thought of was changing "Account Password" from password to email to override user_login.

However, I can't seem to find where the "Password" text box is coming from. I know that this the code I needed under form-billing.php, but I am unsure how only password is showing considering there's a for-loop.

<?php foreach ( $checkout->checkout_fields['account'] as $key => $field ) : ?>

    <?php woocommerce_form_field( $key, $field, $checkout->get_value( $key ) ); ?>

<?php endforeach; ?>

Any advice is appreciated.



via Chebli Mohamed