woocommerce custom field configuration - php

I need your help. Its my first time when I use woocomerce in WP and I don't know how to add custom button. On public product view I must add button with link to selected wikipedia page. On private admin product view I need custom url or text field in (wp-admin->product->add product).
Okey now I create custom field and taxonomiex but I don't know what next.
I tried to find some tutorials but I did not give advice.

I also had a similar situation like this. I purchased a plugin to fix it due to tight deadline. You can do it using below methods:
1) By using ready to use plugins
https://wordpress.org/plugins/woocommerce-custom-product-data-fields/screenshots/
(Free one)
https://codecanyon.net/item/woocommerce-custom-fields-product-addons/11332742
(Paid one)
2) You can also create a plugin by yourself
Basically a plugin will allow you to modify the site as you require without modifying the wordpress core. Learn about Hooks and Filters.
I would suggest you to go with 2nd option, learn to develop plugins so that it will be helpful for you in the long run. Read the documentation https://codex.wordpress.org/Plugin_API. It will take some time but it is worth it.

Related

how to customize article manager in Joomla administrator

i am not that much export in Joomla. and i stuck at one problem.
i want to add some custome fields in article manager page when we add / edit article from admin side. just like wordpress when i add some function in function.php page it reflacts on wp-admin side.
also i want that selection to be effect on front side.
can some one show me is there any way i can add a function in my theme which will show a custome selection fields on admin side and based on that front page changes.
i am using Joomla 3.4
Thanks in advance
You need to write a plugin to add this functionality. There is a recipe here. In the example they are using the #__user_profiles - table, which might be okay, but adding your own table might be more flexible.
This here might also be a useful link.

Can i customize the magento back end for admin users?

I am making an ecommerce website using magento.. I want to know if i can customize the back end as per my requirement.
Example : In the manage products page i want to create a custom page and give the admin users the option to easily add the products (Most of the values will be taken by default) and some will be chosen by user (I want to change the default UI and functionality for the admin users)
Is it possible ?
Yes, it is possible. You can develope a simple module or a simple php one-file-script and add products easily using Magento API. You can set default values to some attributes inline.
I found a blog post, I don't recommend to use that code because it looks messy, but it will give you a hint;
http://magentocoder.jigneshpatel.co.in/automated-quick-simple-product-creation-in-magento/
Also, there's a non-free module in magento connect named "Quick Product Add". It looks like what you need but I didn't test it and this is not a recommendation. You can find it here;
http://www.magentocommerce.com/magento-connect/quick-product-creation.html

How to add vertical tabs (like the product page) to a custom magento admin form

There are many tutorials to adding extra tabs to the product page but I am struggling to find information on how I can create tabs on a new form from scratch. I have looked at the following resources but the information presented doesn't seem to be very clear or my magento isn't good enough to understand it yet:
http://www.excellencemagentoblog.com/module-development-series-magento-admin-module-part3
how to create multiple tab in magento custom module?
I am trying to emulate the tab system that runs vertically down the left side of the product section but on a custom form.
Are there any references out there on how this should be done (similar to the official magento one explaining how to create an admin module)?
p.s I haven't posted code as anything I have is directly from the tutorials.
I ended up working through the excellencemagentoblog version and have successfully got tabs working. The examples given aren't exactly straight forward unless you understand the magento structure really well but the information within the article is adequate enough to work through.

Defining dynamic pages in wordpress plugin

I am creating my first wordpress plugin. In it, the user will have the option to add new cities and view events on those cities.
My client requirement is that the URL must be like this
SITE_NAME/cities/NY
or
SITE_NAME/cities/Califonia
What is decided is that i will create a folder cities and If user tries to create a new city i will create a file in that folder with that city, Further more I will add the entry into the database as well.I will insert PHP code into the file as well.
Being new to WP plugins. Is my approach right (for creating files)? Is there any other way?
Your approach would work if you WEREN'T using Wordpress, but I would absolutely not advise doing what you're suggesting within the Wordpress Framework.
Rather than trying to reinvent the wheel, just about everything you want can be achieved with existing Plugins. I would absolutely suggest taking this route, especially if you don't have much experience with programming Wordpress Plugins.
Step 1:Install Wordpress
Self-explanatory. Can't do anything without this.
Step 2:Install Types
Installing the Types Plugin will give you a nice interface for registering your own Custom Post Types and many other features for extending Wordpress' core capabilities.
Step 3:Register your Custom Post Type
This is where things start to get complicated. Using Types, Register a Custom Post Type called Event. The reason why you want to have each event as its own Post is because each Event is unique. Cities are meant to encapsulate and define groups of events, which brings us to our next step:
Step 4:Register your Custom Taxonomy
Think of a Taxonomy as a way to classify things. Wordpress comes with two default Taxonomies: Categories (hierarchical) and Tags (non-hierarchical). In your case, you will want to define for your new Event Post Type a non-hierarchical Taxonomy called "Cities".
Step 5:Register your Custom Fields
Custom Fields are the easy part. What defines your event? Maybe some fields that define the start and end times of that particular event? A checkbox denoting free refreshments? The sky's the limit. What defining characteristics would all Events have that makes it an Event? Add those in the form of Custom Fields. These will show up on your Event Editor in the form of Meta Boxes. If you don't see the Meta Boxes on the Edit Page for a particular event, be sure to enable it by clicking Screen Options in the upper-right-hand corner of your screen and ticking the checkbox where your fields would be located.
Step 6:Configure your Permalinks
Much of this can be done either through Types itself (when configuring your Custom Taxonomy), or through .htaccess rewrites, or perhaps even through the Wordpress Permalinks Settings (though, it's fairly limited). My suggestion is to tweak your Custom Taxonomy and Permalink Settings first before messing with .htaccess.
And that's it! Hopefully this should be enough to get you started on everything you need.
maiorano84 wrote a fairly comprehensive guide to setting up the stuff you need, Rather than relying on plugins though, I prefer to show you how to write a plugin to register the custom post type and taxonomy. To that effect, I wrote a little plugin that should do everything you need and it has plenty of comments and links to the docs so that you can understand the Why of things.
Code
https://github.com/fyaconiello/WP_Cities_Events
This plugin does several things
Creates a custom post type Event
Creates a custom taxonomy City
Adds custom metaboxes to Event
Adds City taxonomy to Event
This plugin does not require any additional plugins to be installed, it is dependency free and only uses WP core.
URLS
As far as getting the correct URL Structure, I would suggest you read this thoroughly: http://codex.wordpress.org/Using_Permalinks.
I do not understand the structure you want
CITY is a single term w/i the taxonomy *cities*
EVENT is the post single
SITE_URL/cities/CITY would yield a page of all EVENT posts in that CITY
you need a url like: SITE_URL/cities/CITY/EVENT to read a specific event in a specific city
EDIT on how to urls:
In your Settings -> Permalinks administration panel select: "Post name" and save.
Then, go to your Ce Events -> Cities admin screen.
hover over one of your terms (in my case new york city) and click view.
it should open up that term(city)'s list view and the url structure looks like so: http://wp.local/city/new-york-city/
if you need city to read cities, modify line 102 of the main plugin file i shared with you:
'rewrite' => array('slug' => 'city'),
EDIT 2
Why not create City as a Custom Post Type? You can then define a slug 'cities' and get that result, and also add taxonomies like categories and tags to further aid navigation.
Don't do that. WordPress gives you a goog API for doing what you want to do: managing pretty URLs (slugs), database operations (you don't need to write/read files for that) and the right code workflow for registering and triggering actions.
So, I think you have to start reading the basics about WordPress plugins (its philosophy and API) and then just decide if you want to use its custom post types (ready to use) or if you want to create a specific content type.
yes this is fine approach.One more thing that you can do is that instead of adding the code inside the fie..Pick the code from DB.
Make a table in DB,create a column with varchar as datatype and insert the common code in it .

How can I do Magento one page checkout (together with the UI) using API calls?

I want to implement one page checkout part of Magento from the outside of Magento structure (i.e. using API calls). If it is possible, I want to start using the existing code to reduce the implementation effort. So, how can I modify the existing checkout implementation in order to make it run from outside? Or, is there any other implementation which provides Magento checkout functionality together with the UI?
I'm not entirely sure what it is your after but if you're thinking of using Magento checkout say in Wordpress then you could simply include app/Mage.php and use pretty much all the functionality provided by Magento.
Say create a product (you would need one to check out) on the fly if it isn't already in Magento or render any templates - checkout in your case.
Not a problem to insert "add to cart" buttons to any website and use AJAX to request cart contents to the same page.
Also I just needed to code pretty much the same thing for OneStepCheckout which opens up in lightbox and allows you to check out from pretty much anywhere. HTML onepager for example or from Facebook:P

Categories