Woocommerce Remove Fields from the View-Order page - wordpress

I'm using woocommerce version 2.4.6 if that's helpful at all. I'm trying to modify the view-order page of a specific order. The web address would be something like:
http://www.edventurelearning.com/my-account/view-order/244/
The page lists the status of the order, the order details, customer details, and then the billing address. I'd like to remove the billing address section since I don't collect the data and all the payments are done through paypal.
I'm having trouble figuring out how to get rid of the Billing Address field from showing up on the page. (I've already removed the field from the checkout process). view-order.php is the file that creates the page and I can modify it but the code that creates all the order detail sections is lumped into:
do_action( 'woocommerce_view_order', $order_id );
I've found the woocommerce_view_order function which is called by woocommerce_order_details_table which is called by wc_get_template. At that point I get lost and I figure there has to be an easier way to modify what is displayed. All I need to do is remove the Billing Address section.
Thanks for any help.

I posted this in the woocommerce forums and one answer was:
An easier way is to hide it using custom css. I can't see your view order page as I'm not a customer and haven't bought anything, but on my site I would use:
.woocommerce-view-order .woocommerce header.title,
.woocommerce-view-order .woocommerce address
{display:none}
Not very subtle but at least there is no need to maintain a custom version of the relevant template.
That post can be seen here:
Wordpress Forum

Related

How to set catalog_visibility in basic Woocommerce plugin

we need to set the catalog_visibility field (as named in postman) in woocommerce (basic plugin), but it does not seem to work the way we go about it. In wordpress it is the setting under single product on the right side, just below “published on”.
We use an ERP system to push the products to our woocommerce shop and need to find the correct article attribute (we then connect the ERP field with the woocommerce attribute and magic happens ... normally)
When I check the product with postman, the field we want to set is called catalog_visibility.
We thus created a field in our ERP with the exact values visible/catalog/search/hidden as we see in postman and tried assigning the article attribute catalog_visibility and also _visibility (but I think this one is for the extension plugin also called "Catalog Visibility"). Neither one worked.
Interestingly, we found out, that both of the attributes we tried to use (_visibility and catalog_visibility) are now shown on the shop's product page (as a table) under a tab called “additional information”, with the value we tried to transfer.
In the backend it is pushed in to the product “properties” tab.
So it seem the values are pushed into woocommerce, but not where and how we want them to.
Has anyone any idea, which attribute (the name) we need to use, to set the visibility of the product?
Thanks!

How to configure multiple address in woocommerce

I am using woocommerce in my e commerce website. I want my customers to be able to save multiple shipping and billing addresses. The addresses can be viewed and edited from my account page. In the checkout page they should be able to select one of the addresses they have already saved.
I have googled a lot and found absolutely nothing but a plugin which does not serve the purpose. I went through the woocommerce documentation but not able to figure out. I am actually overwhelmed by it and feeling lost.
Please help me guys and at least point me somewhere. This is a very common feature in a lots of website nowadays and i am sure it can be done.
In default, as you know WooCommerce only allow one billing & shipping address. But using custom code or plugins, you can achieve this feature in WooCommerce.
Writing code snippet is little difficult as per your question. But if I need the tweaks you mentioned, my approach will be given below.
Edit Checkout form with option to insert new address / select a address from saved list.
Create option in My Account page to insert new address.
Save the new user data in user meta.
If you are looking for a plugin, I would like to suggest WooCommerce Multiple Addresses Pro plugin which allows your customers to save multiple shipping and billing addresses to their My Account page.
Also the newly added addresses will be available in My Account page of the online store, from where the shopper can add, edit or remove addresses.
Moreover, the shopper can set the addresses as default, billing and shipping separately.I think this plugin will be best solution for your demands.
You might try to use this plugin: Woocommerce Multiple Addresses
If you have the Shipping Multiple Addresses plugin, add [woocommerce_select_multiple_addresses] to the checkout page.
It is working perfect.First i'm going to buy http://www.woothemes.com/products/shipping-multiple-addresses/ this plugging but this plugging save my money.

WooCommerce: Add meta on checkout (for the product)

I have a question regarding WooCommerce.
In the last step of the checkout, I want to add some meta information to the product. Basically, at the end of the checkout process the user can choose to offer the product to a friend. He will enter fields such as friend's email, name...
I want to be able to retrieve this information in the admin panel when I click on the details of the order, in the "product" block.
... And I have to idea how to do that. I found some information on how to add custom fields to the order, but how do I add information to the product in the order and not the order itself?
Thank you. I'm in a bit of a blur right now.
Mike Jolley posted the complete code you can insert in your theme's functions.php
I recently used it and works like a charm.
https://gist.github.com/mikejolley/1604009
I think the Woothemes Product Add-ons plugin may be exactly what you are looking for. You can use it to add custom fields of nearly any type to your individual products. It will display them on the cart page and save them in your admin.
Woocommerce allow some hooks and filters to add fields on checkout pag, but yes it requires strong php knowleget. However there is plugin available here: Checkout option manager plugin

Post privacy in Wordpress

Can a post be hidden from home page, archive view, category lists etc. and viewable only if you have a direct link to it? The blog doesn't have registered readers and is open to public so that would be a mean of hiding some posts from public view without using the password protection.
I asked this question in Wordpress section and the idea there was to use conditional code so I'm asking the question here as well to get closer to the code.
If I used conditioning, would I have to input each post's ID separately to PHP file for archive, categories, search and such?
EDIT:
After reading a bit more all over, I had an idea of creating a private category and then use some kind of conditioning so that posts from that category are hidden. According to Codex, certain category can be hidden from, for example front page but I don't know if there's a way to hide it altogether except when you have a direct link.
Creating a "Private" category is a good solution. It is quite possible to hide this category altogether except via direct link. You just have to "block all the exits" with conditional code.
The default WordPress theme displays posts via the Post Loop. See http://codex.wordpress.org/The_Loop, especially the section entitled "Exclude Posts from Some Category". Just find all the places in your theme's PHP files (e.g. index.php) where this loop is used, and add the conditional code. You'd also need to filter your category list and blog archives in the side menu. Don't add filtering in single.php, otherwise the private post won't display on its own page.
You'd probably want to add a similar condition to filter search results so that private posts aren't leaked via the blog's search tool. There may be more "exits" I haven't thought of, but I'll be sure to update as I do. I'm glad to look at specific code if you so desire.
Understanding WordPress' post query and loop really opens up a world of possibilities for customization.
I found the simplest way - just use Simply Exclude Wordpress plugin. It has the option to exclude each post (or tag, for that matter) from front page, archive, search or feed. It works flawlessly. You can still view the posts by using direct links.
(Not actually an answer that includes code but a working solution nonetheless.)

WordPress Post Date Changes On Update

I have my permalinks in WordPress set to the Month and Name setting. This generates URLs like /blog/2009/09/my-post-name. Every time a post is updated, it changes the posting date, which can potentially change the permalink address.
This is wreaking some havoc on my site, as I'll have banner/button ads throughout that point to the permalink. When a post from August is updated in September, all of the ads become broken links until I discover this and change it.
Is there any way to make the original posting date stay static, despite any updates? I'm looking for something like a plug-in or an overlooked setting, as I have multiple authors with varying degrees of computer literacy.
Thanks for any help!
Cory
Update:
Apparantly this is behaviour that others aren't experiencing, so I'm attaching a screen shot of exactly what's happening. Top image is before saving, bottom image is after saving.
(source: opl.on.ca)
Are you sure updating a post changes the permalink? I don't have this behaviour in my installations. What do changes a permalink is changing the post date.
In database, acoording to this schema, we have post__date and post__modified, two different attributes: used in create an update action. If you're having your post-date modified without modifying it directly
Updating a post date in Wordpress http://img18.imageshack.us/img18/3440/wordpresspostdate.png
then I'm afraid some plugin may be changing it's value.
Reading your description, I'm assuming you're using static links to your banners. Try to use a simple plugin that creates these links based on your post id: some simple routine would do it. You can get some information using get_post for example.
<?php
$my_id = 7;
$post_id_7 = get_post($my_id, ARRAY_A);
$slug = $post_id_7['post_name'];
?>
... or even easier with get_permalink. You need just your post id.
<?php
echo get_permalink(7);
?>
So, at least if your permalinks are changing without a reason and you dont know how to fix them, at least you can build them dinamically.
Just read the codex documentation and Function Reference to see what's avaiable to make your life easier!
I run the same permalink settings and don't have trouble with post updates changing the permalink. There are separate editor settings for the permalink and a user has to specifically change the permalink from that editor, which is right under the post title in the text editing box in the post editor. That's a WP thing to keep permalinks from getting broken all the time.
Maybe you should try using a few static pages? That way you can have both a clean permalink: mysite.com/mypermalink/ that won't change, if in fact your post permalinks are changing from a plugin that you need to use.

Resources