mardi 31 mai 2016

Display Last Purchased Products Woocommerce

I am trying to allow a user to display 50 last purchased product in some page so I edited this code: WooCommerce - Recently purchased products

Which is used for the admin to display 5 recent purchased product by all users. But now the issue is that my edited code doesn't display all purchased products for one users, it only displays 4.

This is my edited code:

  // usage: [sold_products max_products="5" title="Les Dérniers Produits Achetés"]
  // code goes in your child theme's functions.php
  add_shortcode('sold_products', 'sold_products');
  function sold_products($attributes) {
    global $wpdb, $woocommerce;
    $defaults = array('max_products' => 50, 'title' => "Produis Vendus Récements");
    $parameters = shortcode_atts( $defaults, $attributes);
    $max = absint($parameters['max_products']);  // number of products to show
    $title = sanitize_text_field($parameters['title']);
    $html = '<div class="sold_products">'.PHP_EOL;  
    if ($title) {
      $html .= '<h3>'.$title.'</h3>'.PHP_EOL;
    }
    $table = $wpdb->prefix.'woocommerce_order_items';
    $my_query = $wpdb->prepare("SELECT * FROM $table WHERE `order_item_type`='line_item' ORDER BY `order_id` DESC LIMIT %d", $max);  
    $nr_rows = $wpdb->query($my_query);
    if (!$nr_rows) {
      $html .= '<p>No recently sold products found.</p>';
    } else {
      $html .= '<ul>'.PHP_EOL;
      for ($offset = 0; $offset < $nr_rows; $offset++) {
        if ( is_user_logged_in() ) {
          $user_info = wp_get_current_user();
        }
        $row = $wpdb->get_row($my_query, OBJECT, $offset);
        $product_name = $row->order_item_name;
        $product = get_page_by_title($product_name, OBJECT, 'product');
        $url = get_permalink($product->ID);
        $order_id = $row->order_id;
        $order = new WC_Order($order_id);
        $user = $order->get_user();
        if ($user) {
          $user_id = $user->ID;
        } else {
          $user_id = 'Guest';
        }
        if($user_info->ID == $user_id){
          $unix_date = strtotime($order->order_date);
          $date = date('d/m/y', $unix_date);
          $html .= '<li><a href="'.$url.'">'.$product_name.'</a> you purchased on '.$date.'</li>'.PHP_EOL;
        }
      }
      $html .= '</ul>'.PHP_EOL;
    }
    $html .= '</div>'.PHP_EOL;
    return $html;
  } // end function

So can someone tell me what's wrong with this code?

Thank you in advanced!



via Chebli Mohamed

In wordpress generated Fxc393QU.html file

In my wordpress site suddenly generated unknown file which name is Fxc393QU.html in that file only content Fxc393QU. I'm sure this is generated by any script.

I dont know how this happen but due to this query string URL no longer work.

One more thing is this file owner and group is root root

nobody create file without sudo command.

Is my worpdress site hacked ?



via Chebli Mohamed

How to create plugin independent of theme in wordpress

I need to create a plugin in wordpress that should be independent of theme. That means it can work on any theme. Please tell me how can i do this.



via Chebli Mohamed

i want to update only the design of my plugin what is the best way to update design of any wordpress plugin

i want to update only the design of my plugin not the working what is the best way to update any wordpress plugin  , need help pls ...... 


via Chebli Mohamed

How does wp-polls work (What is PHP's Anonymous Personalization methods and best practices)

I know the title might be a bit broad but I chose it to encourage further coverage on this topic since there's not enough resources covering it.

What I've been told is that there's only 3 ways to recognize each user :

  • Cookies : whether it's the usual cookie or a cookie containing session ID

  • -URl : containing the usual GET data or session ID IP Adress

  • User's IP Address

But I tried to workaround wp-polls(which is wordpress plugin for polls/surveys) just to see if I could vote more than one time (only for research purposes I swear :D)

this is the URL(I'm sorry it's not English but I'm sure you'll find the plugin it's the on the left below the nav-bar)

so I tried

  • Deleting the cookies that was sent by the website containing that plugin
  • check the URL (didn't see any session IDs)
  • Browsing the website containing the plugin using a proxy server

The plugin detected me after deleting the cookies,( but when I browsed using the proxy server it detected me on that page but when I went to the Homepage and clicked the vote button it didn't do anything[rather than saying "you've already voted"] probably the proxy server conflicted with the Javascript of the ajax call)

My question is .. how does that plugin work and detect users (did it stopped working on purpose when I used the proxy server?) and what are the methods/best practices to detect users ?



via Chebli Mohamed

How to create a text link the opens the overlayOptimizer in OptimizePress

I'm using the optimizePress live editor to create a page on my wordpress site

On one of my pages on website, I've got a piece text in a box and I want to create a link on that text that opens the overlayOptimizer.

Does anyone know how to achieve this?

Thanks!



via Chebli Mohamed

conditional formatting & dropdown menu in WP

Let's say that i have a dropdown menu with 3 entries:

  1. Option_1
  2. Option_2
  3. Option_3

And 5 textbox:

  1. Box_1
  2. Box_2
  3. Box_3
  4. Box_4
  5. Box_5

I want to implement this rule, but not sure how to proceed:

  1. If user selects Option_1, then disable Box_1, Box_3, Box_4
  2. If user selects Option_2, then disable Box_3, Box_4, Box_5
  3. If user selects Option_3, then disable Box_1 only.

How can I do that? I have tried using Caldera forms and its conditional formatting options, but it seems i can only set one condition per Box (after i set up a rule for Option_1 -> Box_1, when I try to set up a rule for Option_2 I cannot select Box_1 again).

what am i doing wrong?



via Chebli Mohamed

How to display Google AdSense ads to Facebook traffic only?

How to display Google AdSense ads to Facebook traffic only?

Any Easy Way As I'm Not Into Coding.

Thank You :)



via Chebli Mohamed

Replacing entire entry-content contents in WordPress

I am developing a WordPress plugin that is inserted onto the page by adding a token to the page content.

So, on the page there is some introductory text with the contents of the plugin below. On postback, I would like to clear the introductory text and just show output from the plugin.

I know I could do this using jQuery by replacing the contents of $(".entry-content").html("plugin output"); but I wanted to ask if there was a WordPress native method of doing this instead.



via Chebli Mohamed

W3 Total Cache Increases Site Load Time

Since installing W3 Total Cache, my website's load time has shot up to 4.82 seconds (at least doubled), so I'm looking for some help with fixing any issues because I'm almost sure there's an incorrect setting or conflict somewhere. It's quite noticeable, as on first load (after clearing all caches), the page is completely blank for about 2-3 seconds. See http://ift.tt/1UO28q4.

At the moment, I have the following enabled:

  • Page Cache (Disk: Enhanced)
  • Minify (Auto, Disk, Default, JSMin, Default)
  • Browser Cache (Set Last-Modified header, gzip Compression)

Separately, I'm also compressing my images using WP Smush. I've also noticed that PageSpeed Insights doesn't detect browser caching as enabled, stating "expiration not specified".

Any help or guidance would be really appreciated. I can provide more detailed settings if necessary. Thanks in advance!



via Chebli Mohamed

Gravity Forms get merge tag token value

I am doing some customization for catching gravity form results on form submission. I get feed['meta'] array on form submission. But some fields have merge tag values like '{form_title}'. I need to get real value of the field instead of tokens. Following is the array I get on form submission.

Array
(
  [name] => contact_test
  [form_id] => 1
  [contact_count] => 2
  [type] => Contacts
  [signature_text_2] => {Name (Prefix):2.2}{Name (Suffix):2.8}
  [signature_html_2] => {Name (Suffix):2.8}{Name (Prefix):2.2}
)

I am having issues with last 2 fields where merge tags tokens are present. I need to fetch value of the corresponding fields.



via Chebli Mohamed

Integrating media-uploader in plugin wordpress

I'm trying to build a little plugin in wordpress: just a field and a button to upload photos. I have this main page (myplugin.php)

/////////////////////////

<?php

/*
Plugin Name: My Plugin
Version: 1.0
Description: description
Author: xxxxxxx
Author URI: xxxxxx
*/


function myplugin_admin_actions() {
add_options_page('myplugin', 'My Plugin', 'manage_options', __FILE__, 'myplugin_setup_page', get_stylesheet_directory_uri()."/images/plugin_icon.png");
}

add_action('admin_menu', 'myplugin_admin_actions'); 

function myplugin_scripts(){
    wp_enqueue_script('jquery');
    wp_enqueue_script('media-upload');
    wp_enqueue_script('thickbox');  
    wp_register_script('uploader',plugin_dir_url( __FILE__ ).'js/uploader.js', array('jquery','media-upload','thickbox'));  
    wp_enqueue('uploader');     
}

add_action('wp_enqueue_scripts','myplugin_scripts');

function myplugin_setup_page()
{   
?>

<div class="wrap">
<h1>MEDIA UPLOADER PLUGIN</h1>
<h4>First plugin</h4>
<tr valign="top">
<td>Upload Image</td>
<td><label for="upload_image">
<input id="upload_image" type="text" size="36" name="upload_image" value="" />

<input id="upload_logo_button" class="button button-secondary" type="button"  value="Upload Image" />
<br />
Enter an URL or upload an image.
<br/>
</label>
<br/>
</td>
</tr>
</div>
 <?php } ?>

//////////////////////////

and this Javascript file (uploader.js):

//////////////////

jQuery(document).ready(function() {
jQuery('#upload_logo_button').click(function() {
tb_show('Upload a Image', 'media-upload.php?referer=media_page&type=image&TB_iframe=true&post_id=0', false);
return false;
});


window.send_to_editor = function(html) {
var image_url = jQuery('img', html).attr('src');
jQuery('#add_image').val(image_url);
tb_remove();
}

});

//////////////////////

No problems with plugin interface, but I tried to click the upload button without any result (no action, no window opened). I can't understand what's wrong...ok, I'm new with javascript, so I'm sorry in advanced, I think it's no so difficult, but I'm stuck here



via Chebli Mohamed

Images in kiwi logo slider(wordpress plugin) are tiny in safari

The problem page

How it should be

How it is

So this is an interesting issue. On every browser except safari, The images display normally. However, in safari, they are super tiny.

.bx-wrapper ul.kiwi-logo-carousel.align-center li img {
    max-height: 60%;
    max-width: 76%;
    display: inline-block;
}

The only things that my research on this issue has turned up were ineffective in solving the issue:

First attempt

Second Attempt



via Chebli Mohamed

wordpress contact form 7 hidden date field not working as expected

I am using contact form 7 on wordpress4.5.2. My need is i want to capture post_date (the date on which post has been published) and submission_date(the date on which a candidate submit form.

i am trying to achieve above two needs using following tags which is always returning me 'null'/empty in generated email..some pointers are appreciated.

CF7 form
[hidden today_date today]

[hidden post_date id:post_date]

<p>[submit "Send"]</p>

on mail , below tags used..
1 [_post_date]
2 [post_date] 
[_format_post_date "D, d M y"]
3 [today_date]
[_format_today_date "D, d M y"]
4 [_today_date]

result email..
1 [_post_date]
2 

3

4 [_today_date]

thanks in advance



via Chebli Mohamed

How do I pull my own advertised indeed positions to display on my website?

I am trying to pull my job adverts which I have advertised on indeed into my Wordpress built site.

I have obtained a publisher ID however I'm under the assumption that pulling my own advertised jobs isn't possible. All I can see is the functionality to push a 'job roll' that only matches a keyword, company name and location. Not specific to my own adverts.

Am I missing something obvious here?

Would appreciate any help.



via Chebli Mohamed

Saving images using a custom post type in wordpress?

I am trying to save some pictures to the wordpress database within a plugin I am developing (with the help of a tutorial - when I attempt to save my 'slider' post type, I am presented with the following screen:

enter image description here

This is the code..

add_action('save_post', 'fwds_save_slider_info');

function fwds_save_slider_info($post_id) {

    // verify nonce

    if (isset($_POST['fwds_slider_box_nonce']) && !wp_verify_nonce( $_POST['fwds_slider_box_nonce'], basename(__FILE__) )) {
       return $post_id;
    }
    // check autosave
    if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
       return $post_id;
    }
    // check permissions
    if ('slidesjs_slider' == isset($_POST['post_type']) && current_user_can('edit_post', $post_id)) {

       /* Save Slider Images */

        print_r($_POST['gallery_img']);exit;

       $gallery_images = (isset($_POST['gallery_img']) ? $_POST['gallery_img'] : '');

       $gallery_images = strip_tags(json_encode($gallery_images));

       update_post_meta($post_id, "_fwds_gallery_images", $gallery_images);

    } else {
       return $post_id;
    }
}

When i go back and view the sliders I save, the images disappear; what am I doing wrong here?



via Chebli Mohamed

Passing values to wordpress shortcode

<?php while (have_rows('home_playlist', 'option')): the_row();
$track = get_sub_field('home_track'); ?>
echo $track;

Here echo generate some selective IDs 2,4,7,10,12 (mp3 songs title) from wp panel. And I need to show the title on the player. How do i pass the value of $track into the 'ids'....



via Chebli Mohamed

Live Composer plug in to plant my wordpress site

Everything was working fine on Wordpress until we tried the page builder plugin called "Live Composer" (version 1.0.8.4). We installed this plugin without any problem through WP dashboard but when we clicked on "activate" (to activate the plugin), we got an error message (I cannot remember what was written exactly but basically the install has failed). Shortly after that, we first realised that none of the plugins on the website were working (we did refresh various pages of the website), and it became clear that the database was affected. WP could no longer establish a connection with the database.

Right after that we were logged out of the dashboard, with no possibility to log in again. Our login and password no longer worked (there was a redirection to the homepage instead of being logged in the dashboard). We tried (with no success) - to delete "Live Composer" via ftp - to deactivate all plugins via ftp (temporarily rename the plugins folder) - to remove a line linked to "Live Composer" in the database

After all that, since nothing had changed, we put everything back to "normal" and we're still looking for a solution.

By the way, it may be worth mentioning that another page builder called SiteOrigin was already installed when we tried Live Composer.



via Chebli Mohamed

How to use CDN.net in wordpress without Wp Total Cache plugin

We want to use cdn.net for CDN service. But they are recommending WP Total Cache Plugin to configure their CDN on wordpress. We don't want to use WP Total Cache. Is there any other way to use it?



via Chebli Mohamed

How to display wordpress search results in google SERP? I am using Yoast SEO Plugin

I need to display WordPress search result page into Google search Result. I am trying to fetch the URL by using Google Webmaster Tool. But the search result page not indexed by Google. I am Using Yoast SEO free plugin. In Yoast settings, there is no option to display search result page in Google SERP. Please guide me. Thanks in Advance!!!



via Chebli Mohamed

multi request in wordpress ajax plugin at the same time

why wordpress not allow to run multi request at the same time in admin-ajax.php ? when I send these two action iwannawait and idontwannawait to "admin-ajax.php" at the same time , previous request must be complete (in this , code wait for 60s) and next request will start .. I tried multi url query for passing browser waiting requests (admin-ajax.php?req1 .. admin-ajax.php?req2 but is still not work

add_action('wp_ajax_iwannawait', 'iwannawait');
add_action('wp_ajax_idontwannawait', 'idontwannawait');

function iwannawait()
{
sleep(60); 
echo "60!";
die();      
}

function idontwannawait()
{
echo "0!";
die();      
}



via Chebli Mohamed

How to Fix "Failed to send your message" in Contact FORM 7 on wordpress

Hello I have Contact Form 7. It was working nicely. I wanted to add captcha to my form so contact form 7 has an option to add captcha but it requires integration with settings. I followed the same mentioned steps. I went to Google’s reCAPTCHA admin page, Registered my website and got site key and secret key then added those keys to wp-admin Contact > Integration and save them. Then my contact form was not working.

Then i opened the mail tab in my contact form 7. I have lots all the settings. not sure what settings to use.

I have two version of site, one is live and one is demo site. So I have copied the mail settings of demo to live site. Copied exactly the same settings.

My demo's FROM setting contains this

[your-name] <wordpress@demo.lmdemo.com>

For example this is my demo site demo.lmdemo.com so added <wordpress@demo.lmdemo.com> in FROM Section.

My live website is landmarkdoha.com so I replaced the FROM to live one with email wordpress@landmarkdoha.com See below

enter image description here

but my contact form is giving me this error

Failed to send your message. Please try later or contact the administrator by another method.

What I have done so far.

  • I have tested on default theme, still giving me same error.

  • I have deactivated all other plugins, still giving me same error.

  • I have deactivated Contact form 7, and activated again, still same error.

Contact form on my demo site is working perfectly, but not on live website. Contact form has same settings on demo and live. Except the FORM section setting that i have added above in screenshot.



via Chebli Mohamed

wordpress backend development, custom data with angularjs

creating a wordpress plugin, need to fetch custom data from custom tables in dashboard, I want to display data/search and filter using angularjs, is there any prepaid backend snippet/code of angularjs to use in wordpress admin panel easily.



via Chebli Mohamed

access all-in-one-event-calendar functions outside if wordpress

All i am trying to create rest-api and i have successful at retrieving all other posts form WP using this
Calling WP functions outside of functions.php

Now i try same code to access all events using below code and it return me null.

function get_events($body) {
        return json_encode($ai1ec_registry);
//        global $ai1ec_calendar_helper, $ai1ec_events_helper;
        global $ai1ec_registry;
//        global $post;
//        return json_encode($ai1ec_registry);
        $events = new WP_Query('post_type=ai1ec_event');
        $returnevent = [];
        while ($events->have_posts()):
            $events->the_post();
            $event = new Ai1ec_Event($ai1ec_registry);
            $event->initialize_from_id($post->ID);
            $event_name = $event->get('post')->post_name;
//            $returnevent[] = $event_name;
            return $event_name;

//            return json_encode($event_name);
        endwhile;
//        return json_encode($returnevent);
    }



via Chebli Mohamed

how to add contact form 7 on wordpress

Hello Im using Contact Form 7 Wordpress plugin on my website from last few months, This site was build by someone else. Im new to wordpress. My client told me to add a captcha to contact form 7. I have followed the tutorial to add the captcha to contact form and now my contact form is not working. Here are the steps i have followed

  • Go to Google’s reCAPTCHA admin page.

  • Register your site.

  • Get a site key and secret key.

  • Copy the key pair into the WordPress admin screen of the site you registered.

  • Go to the admin menu Contact > Integration.

  • Find reCAPTCHA panel and click Configure Keys.

  • Copy the site key and secret key into the fields and save them.

Steps detail can be found here. Now captcha is added to form, so im testing my form, Whenever i tried fill up the form and click on send button it doesnot send any email. It gives me this error.

Failed to send your message. Please try later or contact the administrator by another method.

My client told me to add captcha because he was receiving lots of same emails again and again. (one email was sending like 20 times) thats why im adding captcha.

I have my contact form working on my demo website but on live website it is not working. I didnot change any code, I have added captcha on demo site and it is working but on live site it is not working. It is giving the same above error. what settings do i have to do?



via Chebli Mohamed

How to embed my part of wordpress site into other wordpress site

I have multiple wordpress sites, whereas every site contains a section which is same on every site. So every time there is change in that section i have to change on all those sites instead i am looking for a way to manage that section from one site.

May be this is possible that i can generate the embed script for that section on one site and use the same on all other site. If so is there a plugin to generate a embed code and use it on other sites ? or is there any alternative way ?

thanks in advance.



via Chebli Mohamed

lundi 30 mai 2016

WooCommerce Cart page customisation

I need to do customization in WooCommerce cart page: As I have two datepicker on cart page, Start Date and End date, then I get total days of these dates. Lets suppose start date is 21-04-2016 and end date is 23-04-2016, the total days are 2 days.
I want to calculate these dates with update cart, meaning when I will choose the start date and end date, and then click on update cart button, the following calculation should be done.

Like Product Price * Quantity * totaldays = Subtotal: 12*2*2 = 48.

I want this similar functionality on Cart page. I have searched but I have not get the exact hook which can help me to sort this problem. I want this feature on cart page but not on product page.

I have got the code of product page where custom field can be used for cart page, but I want this fields on Cart page only.

If anybody can help me that would be highly appreciated.



via Chebli Mohamed

How to display 3 products for all rows in WooCommerce?

I'm using WooCommerce with Wordpress

Problem : My WooCommerce or my theme is listing 3 products in 1st row and one product for other rows!

Question : How can I list my products as 3 products for each row instead of this?

enter image description here

Thanks.



via Chebli Mohamed

WooCommerce statewise shipping

We have a WooCommerce setup, we need multiple state pricing for eg. Maharashtra and Out of Maharashtra (OMS).

So the challenge is that we need to ask customer about his State once he enters in the website and then upto his selection the price of all the products are x in Maharashtra and x+10 in OMS.

Looking for some help on how to proceed with it?



via Chebli Mohamed

how to count the number of views in a post when a post is loaded

Hi i am new to wordpress i want to create a plugin which shows popular post. So i want to count the number of view of each post when it is loaded i have tried this but it always returns 0

add_action('template_redirect','lm_count_post');
function lm_count_post(){
 $count_key = 'post_views_count';
    $count = get_post_meta($postID, $count_key, true);
    if($count==''){
        $count = 0;
        delete_post_meta($postID, $count_key);
        add_post_meta($postID, $count_key, '0');
    }else{
        $count++;
        $x=update_post_meta($postID, $count_key, $count);
        print_r();
    }
    echo $count; //die();
}

i am not sure whether the add_action function which i gave is right or not. Any one Please help me



via Chebli Mohamed

On local development environment font-icon (si-atelier) display perfectly, but on production server some thing missing

On local development environment font-icon (si-atelier) display perfectly, but on production server icon not displayed on Chrome and mozilla but on on IE9.

I want those icon: enter image description here On my local server it perfect.

But when i upload in production server, there is the problem:

enter image description here

Mozilla and Chrome not showing that icon, but IE9 show that icon perfectly.i'm using a shared hosting.

the console show this problem, but i'm not understand. Think their is a font-face problem.

enter image description here

Thanks advance all for helping me.



via Chebli Mohamed

Exporting Wordpress Users to Json

I would like to export my users database to json every night with a cron or something. Question is if anyone knows how to export my users to a json file?

Thanks.



via Chebli Mohamed

convert shortcode into an array?

I am using product-brands-for-woocommerce plugin in wordpress for managing the brands. I want, is there any way to [pbf_wc_grid] (shortcode) into an array? so that I can use the image url to show in brand logo jquery plugin.



via Chebli Mohamed

WooCommerce: Only 1 product in cart. Replace if one is added

I am fairly new to WooCommerce so I dont know what could be of use to answer my question, this is why I have not added any codeblocks.

I would like to let customers only add one product to the cart and if they add another product the current product in cart is replaced by the last one.

Do I need to make changes in the code or is it possible with a plugin or WooCommerce setting?

I am looking forward to helpful replies.

Thanks



via Chebli Mohamed

WooCommerce Social Login - Usernames

I was sent here by WooThemes as giving coding examples is apparently against their Support Policy? I'm hoping one of you have experience with this and I'm in the right place. As an FYI, I'm novice with Wordpress and programming in general so please keep that in mind. Thanks.

Anyway, the WooCommerce Social plugin creates usernames from the users email address which doesn't look very good, especially when you don't want to broadcast it on a social site. Here is what they said in their FAQ regarding it:

Q: I don’t want the plugin to create usernames from the user’s email. How do I change this?

A: We have a filter that will let you change this. You’d use the

wc_social_login_{$provider_id}_new_user_data

filter listed in our hook reference to change the 'user_login' to something else, such as a first name, unique ID, or random string.

This is the link they provided http://ift.tt/1U1Dn7a.

Can anyone provide some direction? I have no idea how to use a filter to achieve creating a username from the first name and a random string and then save it to the database.

Thanks so much in advance!

Raw



via Chebli Mohamed

Wordpress Visual Composer plugin's text block option not working

When I take a text block option in Visual Composer and Write text, then save and Update the page. After reloading the page I didn't get any text. then I again open that text block and I found nothing.



via Chebli Mohamed

Form PHP/CSS/HTML wordpress

please i installed a plugin in wordpress to let guests publish(its a free medical advises the guest post and the doctor answer) so i installed the plugin User Submitted Posts now i'm customizing the form but i see this background in the form i want a simple form and easy to use i can't remove this background

enter image description here

The php/html

    <?php // User Submitted Posts - HTML5 Submission Form

if (!function_exists('add_action')) die();

global $usp_options;

$current_user = wp_get_current_user();

if ($usp_options['disable_required']) {
    $required = ''; 
    $captcha = '';
    $files = '';
} else {
    $required = ' data-required="true" required';
    $captcha = ' user-submitted-captcha'; 
    $files = ' usp-required-file';
} ?>

<!-- User Submitted Posts @ http://ift.tt/1KESg0k -->
<div id="user-submitted-posts">
    <?php if ($usp_options['usp_form_content'] !== '') echo $usp_options['usp_form_content']; ?>

    <form id="usp_form" method="post" enctype="multipart/form-data" action="">
        <div id="usp-error-message" class="usp-callout-failure usp-hidden"></div>
        <div id="usp-success-message" class="usp-callout-success usp-hidden"></div>
        <?php echo usp_error_message();

        if (isset($_GET['success']) && $_GET['success'] == '1') :
            echo '<div id="usp-success-message">'. $usp_options['success-message'] .'</div>';
        else :

        if (($usp_options['usp_name'] == 'show' || $usp_options['usp_name'] == 'optn') && ($usp_options['usp_use_author'] == false)) { ?>

        <fieldset class="usp-name">
            <label for="user-submitted-name"><?php _e('Votre Nom ', 'usp'); ?></label>
            <input name="user-submitted-name" type="text" value="" placeholder="<?php _e('Votre Nom', 'usp'); ?>"<?php if (usp_check_required('usp_name')) echo $required; ?> class="usp-input">
        </fieldset>
        <?php } if (($usp_options['usp_url'] == 'show' || $usp_options['usp_url'] == 'optn') && ($usp_options['usp_use_url'] == false)) { ?>

        <fieldset class="usp-url">
            <label for="user-submitted-url"><?php _e('Your URL', 'usp'); ?></label>
            <input name="user-submitted-url" type="text" value="" placeholder="<?php _e('Your URL', 'usp'); ?>"<?php if (usp_check_required('usp_url')) echo $required; ?> class="usp-input">
        </fieldset>
        <?php } if ($usp_options['usp_email'] == 'show' || $usp_options['usp_email'] == 'optn') { ?>

        <fieldset class="usp-email">
            <label for="user-submitted-email"><?php _e('Votre Email', 'usp'); ?></label>
            <input name="user-submitted-email" type="text" value="" placeholder="<?php _e('Votre Email', 'usp'); ?>"<?php if (usp_check_required('usp_email')) echo $required; ?> class="usp-input">
        </fieldset>
        <?php } if ($usp_options['usp_title'] == 'show' || $usp_options['usp_title'] == 'optn') { ?>

        <fieldset class="usp-title">
            <label for="user-submitted-title"><?php _e('Titre', 'usp'); ?></label>
            <input name="user-submitted-title" type="text" value="" placeholder="<?php _e('Titre', 'usp'); ?>"<?php if (usp_check_required('usp_title')) echo $required; ?> class="usp-input">
        </fieldset>
        <?php } if ($usp_options['usp_tags'] == 'show' || $usp_options['usp_tags'] == 'optn') { ?>

        <fieldset class="usp-tags">
            <label for="user-submitted-tags"><?php _e('Post Tags', 'usp'); ?></label>
            <input name="user-submitted-tags" type="text" value="" placeholder="<?php _e('Post Tags', 'usp'); ?>"<?php if (usp_check_required('usp_tags')) echo $required; ?> class="usp-input">
        </fieldset>
        <?php } if ($usp_options['usp_captcha'] == 'show') { ?>

        <fieldset class="usp-captcha">
            <label for="user-submitted-captcha"><?php echo $usp_options['usp_question']; ?></label>
            <input name="user-submitted-captcha" type="text" value="" placeholder="<?php _e('Antispam Question', 'usp'); ?>"<?php echo $required; ?> class="usp-input exclude<?php echo $captcha; ?>">
        </fieldset>
        <?php } if (($usp_options['usp_category'] == 'show' || $usp_options['usp_category'] == 'optn') && ($usp_options['usp_use_cat'] == false)) { ?>

        <fieldset class="usp-category">
            <label for="user-submitted-category"><?php _e('Maladie', 'usp'); ?></label>
            <select name="user-submitted-category"<?php if (usp_check_required('usp_category')) echo $required; ?> class="usp-select">
                <option value=""><?php _e('Choix du maladie.', 'usp'); ?></option>
                <?php foreach($usp_options['categories'] as $categoryId) { $category = get_category($categoryId); if (!$category) { continue; } ?>

                <option value="<?php echo $categoryId; ?>"><?php $category = get_category($categoryId); echo sanitize_text_field($category->name); ?></option>
                <?php } ?>

            </select>
        </fieldset>
        <?php } if ($usp_options['usp_content'] == 'show' || $usp_options['usp_content'] == 'optn') { ?>

        <fieldset class="usp-content">
            <?php if ($usp_options['usp_richtext_editor'] == true) { ?>

            <div class="usp_text-editor">
            <?php $settings = array(
                    'wpautop'          => true,  // enable rich text editor
                    'media_buttons'    => true,  // enable add media button
                    'textarea_name'    => 'user-submitted-content', // name
                    'textarea_rows'    => '10',  // number of textarea rows
                    'tabindex'         => '',    // tabindex
                    'editor_css'       => '',    // extra CSS
                    'editor_class'     => 'usp-rich-textarea', // class
                    'teeny'            => false, // output minimal editor config
                    'dfw'              => false, // replace fullscreen with DFW
                    'tinymce'          => true,  // enable TinyMCE
                    'quicktags'        => true,  // enable quicktags
                    'drag_drop_upload' => true, // enable drag-drop
                );
                wp_editor('', 'uspcontent', apply_filters('usp_editor_settings', $settings)); ?>

            </div>
            <?php } else { ?>

            <label for="user-submitted-content"><?php _e('Votre Problém', 'usp'); ?></label>
            <textarea name="user-submitted-content" rows="5" placeholder="<?php _e('Votre Problém', 'usp'); ?>"<?php if (usp_check_required('usp_content')) echo $required; ?> class="usp-textarea"></textarea>
            <?php } ?>

        </fieldset>
        <?php } if ($usp_options['usp_images'] == 'show') { ?>
        <?php if ($usp_options['max-images'] !== 0) { ?>
        textarea 
        <fieldset class="usp-images">
            <label for="user-submitted-image"><?php _e('Image ici', 'usp'); ?></label>
            <div id="usp-upload-message"><?php echo $usp_options['upload-message']; ?></div>
            <div id="user-submitted-image">
            <?php // upload files
            $minImages = intval($usp_options['min-images']);
            $maxImages = intval($usp_options['max-images']);
            $addAnother = $usp_options['usp_add_another'];

            if ($addAnother == '') $addAnother = '<a href="#" id="usp_add-another" class="usp-no-js">' . __('Une autre Image', 'usp') . '</a>';
            if ($minImages > 0) : ?>
                <?php for ($i = 0; $i < $minImages; $i++) : ?>

                <input name="user-submitted-image[]" type="file" size="25"<?php echo $required; ?> class="usp-input usp-clone<?php echo $files; ?> exclude">
                <?php endfor; ?>
                <?php if ($minImages < $maxImages) : echo $addAnother; endif; ?>
            <?php else : ?>

                <input name="user-submitted-image[]" type="file" size="25" class="usp-input usp-clone exclude">
                <?php echo $addAnother; ?>
            <?php endif; ?>

            </div>
            <input class="usp-hidden exclude" type="hidden" name="usp-min-images" id="usp-min-images" value="<?php echo $usp_options['min-images']; ?>">
            <input class="usp-hidden exclude" type="hidden" name="usp-max-images" id="usp-max-images" value="<?php echo $usp_options['max-images']; ?>">
        </fieldset>
        <?php } ?>
        <?php } ?>

        <fieldset id="coldform_verify" style="display:none;">
            <label for="user-submitted-verify"><?php _e('Human verification: leave this field empty.', 'usp'); ?></label>
            <input class="exclude" name="user-submitted-verify" type="text" value="">
        </fieldset>
        <div id="usp-submit">
            <?php if (!empty($usp_options['redirect-url'])) { ?>

            <input class="usp-hidden exclude" type="hidden" name="redirect-override" value="<?php echo $usp_options['redirect-url']; ?>">
            <?php } ?>
            <?php if ($usp_options['usp_use_author'] == true) { ?>

            <input class="usp-hidden exclude" type="hidden" name="user-submitted-name" value="<?php echo $current_user->user_login; ?>">
            <?php } ?>
            <?php if ($usp_options['usp_use_url'] == true) { ?>

            <input class="usp-hidden exclude" type="hidden" name="user-submitted-url" value="<?php echo $current_user->user_url; ?>">
            <?php } ?>
            <?php if ($usp_options['usp_use_cat'] == true) { ?>

            <input class="usp-hidden exclude" type="hidden" name="user-submitted-category" value="<?php echo $usp_options['usp_use_cat_id']; ?>">
            <?php } ?>

            <input class="exclude" name="user-submitted-post" id="user-submitted-post" type="submit" value="<?php _e('Envoyer', 'usp'); ?>">
            <?php wp_nonce_field('usp-nonce', 'usp-nonce', false); ?>
        </div>
        <?php endif; ?>

    </form>
</div>
<script>(function(){var e = document.getElementById('coldform_verify'); if(e) e.parentNode.removeChild(e);})();</script>
<!-- User Submitted Posts @ http://ift.tt/1KESg0k -->

The CSS

    @charset "UTF-8";
/* 
    User Submitted Posts > CSS > HTML5 form
    http://ift.tt/1KESg0k
    Complete list of CSS hooks for the submission form @ http://m0n.co/e
*/

div#user-submitted-posts fieldset input[type=text] {
    border: none;
    border-bottom: 2px solid #37b8eb;
    clear: both; width: 70%;
}

div#user-submitted-image input[type=file] {
    border: none;
    border-bottom: 2px solid #37b8eb;
    clear: both; width: 70%;
}

div#user-submitted-posts textarea  {
    border: none;
    border-bottom: 2px solid #37b8eb;
    clear: both; width: 70%;
}

div#user-submitted-posts fieldset label{ 
clear: both; width: 70%;
}

div#usp-submit input[type=submit] {
    background-color: #37b8eb;
    border: none;
    color: white;
    padding: 12px 62px;
    text-decoration: none;
    margin: 4px 2px;
    cursor: pointer;
}

div#user-submitted-posts { border-radius: 5px; background-color: #f2f2f2; padding: 10px; width: 100%; font-size: 15px; }
div#user-submitted-posts fieldset { margin: 10px 0; padding: 0; border: 0; background-color: #f2f2f2; }

/*div#user-submitted-posts fieldset label           { float: left; clear: both; width: 70%; margin: 0; padding: 0; line-height: 18px; }*/
/*div#user-submitted-posts fieldset input.usp-input { float: left; clear: both; width: 70%; margin: 0; padding: 5px; font-size: 12px; }*/
/*div#user-submitted-posts textarea.usp-textarea    { float: left; clear: both; width: 80%; margin: 0; padding: 5px; font-size: 12px; }*/
/*div#user-submitted-posts select                   { float: left; clear: both; width: auto; margin: 0; padding: 5px; font-size: 12px; }*/

div#user-submitted-image { float: left; clear: both; width: 70%; }
div#usp-upload-message   { float: left; clear: both; width: 70%; }
a#usp_add-another        { float: left; clear: both; }

div#user-submitted-posts fieldset input.usp-input.usp-clone { width: 90%; margin: 0 0 5px 0; padding: 7px; background-color: #fafafa; }
/*div#usp-submit { margin: 15px 0; }*/

/* JS > Parsley */
.parsley-errors-list {
    list-style-type: none; float: left; clear: both; margin: 0; padding: 0; font-size: 11px; line-height: 18px; color: #fff; background-color: #cc3333;
    -webkit-transition: all 0.5s ease-in; -moz-transition: all 0.5s ease-in; -o-transition: all 0.5s ease-in; transition: all 0.5s ease-in;
    opacity: 0; -moz-opacity: 0; -webkit-opacity: 0;
    }
.parsley-errors-list.filled { opacity: 1; }
.parsley-required { margin: 0; padding: 2px 3px; }
.usp-files-error { margin-top: -5px; }
.usp-hidden, .usp-no-js { display: none; }
.usp-js { display: block; }



via Chebli Mohamed

Appending bootstrap modal with unique ID into table cell

I am working on a WordPress plugin at the moment and i am currently dealing with some kind of bug.

So this is problem i have expandable div's representing each day, you can add and remove them dynamically, screenshot

When you enter values in these two slots (time/location) and click create table button, time x location table is generated, screenshot.

So when user click on +Add event, modal should be shown. And this work perfectly for first day, when i add other days modals inside their td elements also have unique id's but they are not showing on +Add event click, when i inspect DOM i find they are printed more then one time(8 times to be more precise no matter how big table is)but they are not visible. Interesting fact is that when i click update(Wordpress button that save changes and refresh page) the modals start working on other days too.

Here is the code that prints the table :

   // unique id counter
    var uniID = 0;
       // if slots not empty
        if(numTS !== "" || numLS !== "") {
        var target = jQuery("div").find("[data-iterator='" + curr + "']"); 
        var content = '<table style="margin-top: 25px" class="table table-bordered"><tbody class="tbd' + curr + '"><tr class="tabelica' + curr + '">';
          content += '<td><span class="locc">Location</span> <span class="tslott">Timeslots</span></td>';
           // generate x part of table
           for (var i = 0; i < numTS; i++) {
               content += '<td class="tslot-fields">';
               content += '<div class="col-xs-12 tslot-name-div"><input class="tslot-name" type="text" placeholder="Name"> Pause <input type="checkbox"></div>';
               content += '<div class="col-xs-6 tslot-fields-div">Starts<br/><select><option>00:00</option><option>00:15</option></select></div>';
               content += '<div style="margin-top: 15px;" class="col-xs-6">Ends<br/><select><option>00:00</option><option>00:15</option></select></div>';
               content += '</td>';
           }
           content += '</tr>';
            // generate y part of table
            for(var j = 0; j < numLS; j++) {

                content += '<tr><td class="loc-fields"><input class="loc-input" type="text" placeholder="Loaction Name"> </td>';
                for(var k = 0; k < numTS; k++) {
                    var id = ++uniID;
                    content += '<td><button type="button" class="btn btn-custom" data-toggle="modal" data-target="#myModal' + id + '"> +Add event</button><div class="modal fade" id="myModal' + id + '" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <h4 class="modal-title" id="myModalLabel">Modal title</h4> </div><div class="modal-body"> ... </div><div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="button" class="btn btn-primary">Save changes</button> </div></div></div></div></td>';
                }
                content += '</tr>';
            }
          content += '</tbody></table>';
          target.append(content);
 }            

Really hope you guys can help me I am desperate about this.



via Chebli Mohamed

Can't access iframe contents and hover on divs

i am trying to access iframe with jquery at the same domain eg current site url: http://example.com

Platform:wordpress plugin

 <iframe id="mmIframe" src="http://example.com"></iframe>

I tried this but not working:

var $j = jQuery.noConflict();
$j(document).ready(function(){
           'use strict';

               $j("#mmIframe").contents().find(".logo").hide(); 

               $j("#mmIframe").contents().find("div").hover(
                 function() { $j(this).addClass("mm-Hover"); },
                 function() { $j(this).removeClass("mm-Hover"); }
                );


});

I have <div class="logo"></div> inside my iframe.

I dont have any error's in developer console and i set allow origin to be sure its not the issue.

How i access iframe and hover inside contents?



via Chebli Mohamed

WooCommerce products in Custom Post Type

I am trying to use the Woocommerce category taxonomy to display relevant products on a page. The custom post type allows me to add the product category list to the custom page but I am not sure how to filter it to only show the category I select for the respective page. At the moment it is showing all my products, not filtering the ones I need:

$args = array( 'post_type' => 'product', 'posts_per_page' => -1, 'taxonomy' => 'product_cat' );

$loop = new WP_Query( $args );

while ( $loop->have_posts() ) : $loop->the_post();
    global $product; 
    echo '<div class="background-img"><a href="'.get_permalink().'">' . woocommerce_get_product_thumbnail().'<br /> '.get_the_title().'</a>';
    echo $product->get_price_html();
    echo '<form class="cart" method="post" enctype="multipart/form-data">
     <input type="hidden" name="add-to-cart" value="';
    echo esc_attr($product->id);
    echo '">
     <button type="submit">';
    echo $product->single_add_to_cart_text();
    echo '</button>
        </form>';
    echo '</div>';
endwhile; 

$attachment_ids = $product->get_gallery_attachment_ids();

foreach( $attachment_ids as $attachment_id )
{
    echo $image_link = wp_get_attachment_url( $attachment_id );

}
wp_reset_query(); 

Here is a version of the dev site, it is still quite raw and needs alot of styling but should give an idea:

http://ift.tt/1X7M3zS

I'm using the following plugin:

http://ift.tt/1pun0SW

I can create a custom taxonomy but it is an extra step and produces the same results. I think I may be missing something small but I'm just not getting it.



via Chebli Mohamed

Dynamic URLs for Product pages in eCommerce sites. Any wordpress plugin?

I am developing an e commerce site for a client on word press. It is dynamic site where client can add/remove categories, sub categories & products to website. Do i have any plugin in word press, where it can read product info and create custom url.



via Chebli Mohamed

Change "My Account" to "Username" woocommerce sidebar

I want to display for users once logged in instead of the default word My Account I want to display the user's name, I tried this code but it doesnt display anything! it seems it doesn't recognized that variable!$current_userin the file located at: wp-content/themes/themeName/framework/functions/woo-account.php

printf( __( '%s', 'wpdance' ),$current_user->user_lastname);

it was:

printf( __( 'My Account', 'wpdance' ));

Does someone have any suggestion or idea?

Thank you in advanced!



via Chebli Mohamed

How to use gravity form as a cost estimator?

I am working on a logistic website and I want to use gravity form as a cost estimator.

Here is a scenerio, I have different shipping prices for different regions for my form.

Example New York to New York (Delivery charges is $20), New York to New Jersey ($30) and so on.

The user will select their resident state from a dropdown and select the delivery address from another dropdown, how to i assign delivery cost to dropdown value as they are selected.

Thanks



via Chebli Mohamed

dimanche 29 mai 2016

WooCommerce coupon code Apply on product page..?

I am trying to apply coupon code on the product page. But there are not apply on the exact way, like it's apply but already add in the cart.

I need to first validate coupon code then apply on the cart.

Here I attached a screenshot, for my condition.

enter image description here

Thanks in advance.



via Chebli Mohamed

Wordpress - Listify product vendors role

I am using listify theme in wordpress. I am having trouble getting up woocommerce bookings and product vendors.

Currently when a business owner signs up and creates an account they are given the role EMPLOYER.

This allows them to create listings etc

Product vendor requires the user to be use VENDOR ADMIN.

it also requires them to sign up to a completely different form.

I am confused as to how to join these two products.

Do I just change the default role for listify creation to VENDOR ADMIN?

Also I will be creating two subscription packages. One free and one paid ... the free package would not allow access to product vendors. I also have no idea how to config this!

Thanks!



via Chebli Mohamed

How can I show Products tags on same product page in WooCommerce

I'm using WooCommerce plugin.

I want to show "Products tags" for the same product on single product page. I have tried everything and it hasn't worked.

Please, can anyone help me with some solution?



via Chebli Mohamed

Wordpress form-builder plugins throwing errors

I'm trying to use some Wordpress plugin to make a form with possibility to upload files by users. Every form-building plugin I installed build form correctly but was unable to submit - it throws an error like "ReferenceError: ObjectName is not defined".

FileAway throws: ReferenceError: FileUpConfig is not defined

Wordpress File Upload throws: ReferenceError: wfu_Initialize_Consts is not defined

Huge IT Forms throws: ReferenceError: huge_it_obj is not defined

I can't find any information about this on plugin site or on Stack. Other plugins work well.

Thank you in advance for any help.



via Chebli Mohamed

How can I modify a Woocommerce shipping label

I am creating a Wordpress Woocommerce site. I need to have the International Flat Rate Shipping say "Call Us For Rates" instead of "International Shipping (Free)". The only value that I can change on the admin side that updates this text is to add a price. There is no way to add a label or change the price or free to text.

Can anyone suggest a way to do this?



via Chebli Mohamed

simple condition on wordpress function.php not work

i want add a new field "title" on comment of wordpress, after insert the new input field in a default form of wordpress i added this in my function.php for save the title when new comment are submitted.

this is the code i use for save title:

function add_comment_meta_values($idcommento) {

global $post;
$idcommento= get_comment_ID();
$tipodipost= get_post_type($post->ID);

            if( get_post_type($post->ID) == 'service') {



            if(isset($_POST['title_svz']) ) {
        $title= wp_filter_nohtml_kses($_POST['title_svz']);
        add_comment_meta( $idcommento , 'title_svz', $title, false);
            }}

}

add_action ('comment_post', 'add_comment_meta_values', 1);

this code work only when remove the condition :

      if( get_post_type($post->ID) == 'service') {}

and i don't understand why, i have already tried this condition in comment.php or in a footer with simple function like this

function test_function() {

            if( get_post_type($post->ID) == 'service') { echo 'done'; }


}
add_action( 'wp_footer', 'test_function' );

and it's work, so i don't understand why don't work in my primary code, any idea ?



via Chebli Mohamed

WooCommerce page css file

I'm attempting to rearrange the layout for my WooCommerce pages, specifically the individual product page. But I can't find where the CSS code is. I'm looking for:

class="woocommerce-tabs wc-tabs-wrapper"

The css file for woocommerce-tabs wc-tabs-wrapper.



via Chebli Mohamed

Hide billing address from checkout page but keep the information

I want to hide the billing address from the checkout page (not remove it) and make the billing address set for the first time when registered?

To allow display on the bill .pdf

So which code shall I add or edit?

Thank you in advance.



via Chebli Mohamed

Get the id of a WooCommerce category, by name

I have a wp template that I would like to assign to some pages. The template would ie. display all WooCommerce products that have the same master category name as the pages name itself.

By far I have tried using this code, but with no good output:

$idObj = get_category_by_slug($pagename);
$id = $idObj->term_id;
echo ": ". $id;

Unfortunately, the echo does not display anything.
Echoing $pagename works, and returns me the slug of the page.

Any good way I could make this work?



via Chebli Mohamed

samedi 28 mai 2016

mailchimp subscribe-form not sending email

I Had a mailchimp embedded subscribe form and switched now to plugin for WordPress it doesn't make a difference.

When I make a test subscription with different email adresses but I never receive an email. No errors.

If someone has encountered this before I would appreciate any pointing in the right direction.

Thanks.



via Chebli Mohamed

WooCommerce add data- attribute to view cart button on success message

I've managed to change the html markup of the View Cart button on success message so I could add id="open_cart" to it, but I also want to add a data- attribute such as data-cart="open" to the html output, however only the id is returned.

Any ideas on how to add a data- attribute to it?

function my_add_to_cart_message() {
    if ( get_option( 'woocommerce_cart_redirect_after_add' ) == 'yes' ) :

    $message = sprintf( '%s<a id="open_cart" data-target="open-cart"  href="%s" class="button">%s</a>', __( 'Successfully added to cart.' , 'woocommerce' ), esc_url( get_permalink( woocommerce_get_page_id( 'cart' ) ) ), __( 'View Cart', 'woocommerce' ) );

    return $message;

}
add_filter( 'wc_add_to_cart_message', 'my_add_to_cart_message' );

This is what the function above returns:

<a id="open_cart" href="http://ift.tt/19O1Z3i" class="button wc-forward">Ver carrinho</a>

The data-cart="open" is ignored. Simply annoying.



via Chebli Mohamed

Woocommerce add_filter only works when logged in

I use a filter provided by Woocommerce Composite Products plugin to update quantities of products in a set. When I am logged in this filter works as intended, but when I am not logged in the quantities are not updated.

I use the following code:

add_filter( 'woocommerce_composited_product_quantity', 'update_quantity', 10, 6);

function update_quantity($qty_value, $min_quantity, $max_quantity, $product, $component_id, $composite_product)
{

  $soort_verwarming = $_POST['soort'];

  $retrieve_data = WC()->session->get( 'quantities' );

  $postname = $product->post->post_name;

    if($postname == 'verdeler-basis') {
        return 1;
    }
    else if (strpos($postname, 'verdeler-')) {
        return 1;
    } else {
        $value = is_numeric($retrieve_data[$soort_verwarming][$postname]) && $retrieve_data[$soort_verwarming][$postname] > 0 ? $retrieve_data[$soort_verwarming][$postname] : 1;
        return (int)$value;
    }
}

The values of $soort_verwarming and $retrieve_data are available, which led me thinking that the filter is somehow not working when a user is not logged in.

$retrieve_data[$soort_verwarming][$postname] corresponds to a number which should be returned for each product and update its quantity.

Are there reasons why add_filter would not work for not logged in users?



via Chebli Mohamed

WordPress woocommerce plugin changing theme layout

I am developing a woocommerce related theme and issue I am facing is that when ever I go to shop page or any page it changes my layout. It removes my .container class and convert that class to #container id and so my 1170px layout is not showing up and all my data is 100%.

I am new to woocommerce kindly guide me how to fix this?

My container class is working fine on all other pages instead woocommerce.



via Chebli Mohamed

Woocommerce hide out of stock products whole the site. Should hide if its variant is out of stock

I have seen so many links on stakeoverflow that are using some code to hide out of stock product. But its not working for me. I want to hide out of stock products from whole the site.

No matter the product is simple or variable, it should hide the product from whole site. In case of variable product if any of its attribute have 'Out of stock' state then it should hide that product.



via Chebli Mohamed

Remove "View Cart" link which appears after click on the "Add To Cart" button in WooCommerce

I am using Wordpress version 4.5.2 and WooCommerce version 2.5.5.

After clicking on the "Add To Cart" button, one link appears "View Cart".

Can anyone help me to remove that link?

Text to remove:

Text to remove



via Chebli Mohamed

WordPress CPT UI - Change the URL Slug of the Post Type

I had to install the plugin CPT UI (Custom Post Type UI) in my wordpress, then I create a new Post Type named Collectie, so when I opened the post Retro that I publish on this Collectie its URL will be (http://ift.tt/1WRzwj3), then I made a new Post Type again with the name Product, then I publish a post Dressoir on this Product, so the URL will be like (http://ift.tt/22rMAvN) , but I wanted when I opened the post Dressoir its URL is (http://ift.tt/1WRzYOi), how to do that ?



via Chebli Mohamed

vendredi 27 mai 2016

Using Facebook SDK in WordPress plugin

I need to use Facebook Ads API in my WordPress plugin. The most classic way to use the Ads API instance is by setting it globally, like this:

Api::init($app_id, $app_secret, $access_token);

It's bad idea to use it this way from the plugin though, as it will be in conflict with other plugins using different Facebook app.

Instead, I can pass API instance to every object's constructor, like this:

$api = new FacebookAds\Api(
    new FacebookAds\Http\Client,
    new FacebookAds\Session($app_id, $app_secret, $access_token)
);

$ad = new FacebookAds\Object\Ad($id, $parent_id, $api);

But it's not very comfortable. Is there any kind of object factory in Facebook Ads SDK? Or maybe you guys have other ideas to make my plugin portable and bind Facebook app id, app secret and access token to my calls, instead of setting then globally?



via Chebli Mohamed

WordPress: Customize subject in new comment notification e-mails

What code should I use to customize the subject of notification e-mails in a WordPress blog?

I mean the e-mails sent to post authors when a comment has been left by someone on their post.

At the moment the subject is about:

[%site-title%] Comment: "%post-title%"‏

I'd like to use:

New comment is waiting for you



via Chebli Mohamed

wordpress buddypress register page layout issue

I have wordpress buddypress and buddypress-multilingual plugin installed. I have one registration page in english language registration page design comes ok.

but if i select russian language registration page than it is not take stylesheet. design goes away.

please help me to solve this issue.



via Chebli Mohamed

Wp Multi File Uploader not working

Using WordPress plugin (wp-multi-file-uploader) to upload multiple files in my site. it is uploading the file when I submit the form it does not show up in post i am unable to get it in post. what could be wrong?



via Chebli Mohamed

Convert dropdown into autocomplete search box in wordpress categories

The following code displays a list of all locations in a dropdown in my wordpress website. How can i change it into autocomplete search box, where it predicts users input on typing a minimum of 3 characters.

 <?php if( $has_location && $can_search_by_location ) : ?>
    <!-- Location field -->
    <div class="form-group">
        <label><?php _e( 'Location', 'advanced-classifieds-and-directory-pro' ); ?></label>
        <?php 
            wp_dropdown_categories( array(
                'show_option_none' => '-- '.__( 'Select a location', 'advanced-classifieds-and-directory-pro' ).' --',
                'taxonomy'         => 'acadp_locations',
                'name'             => 'loc',
                'id'               => 'acadp-location-search-'.$this->id,
                'class'            => 'form-control',
                'orderby'          => 'name',
                'selected'         => isset( $_GET['loc'] ) ? (int) $_GET['loc'] : -1,
                'hierarchical'     => true,
                'depth'            => 10,
                'show_count'       => false,
                'hide_empty'       => false,
            ) );
        ?>
    </div>
 <?php endif; ?>



via Chebli Mohamed

In Wordpress How to register course as individual or company?

I have installed woocommerse plugin to register course.

We need the functionality like user can register or buy the course as an individual or as an company. just like This Page.

Which additional plugin do we need to use?
Do I need to change the plugin from woocommerce to any other? Which one?



via Chebli Mohamed

The use of the wp_parse_args function using parenthesized "array"?

I've been trying (somewhat unsuccesfully) my hand at plugin development and in a tutorial I am going through, the author specifies the wp_parse_args function as follows:

$instance = wp_parse_args( (array) $instance, $defaults );

This is within an extended class of WP_Widget. I am just wondering about the use of the parenthesized "array" within the function? On the codex wordpress states that the function merges an array of default values and an array of arguments, but the syntax used in the codex does not include a parenthesized 'array'. What is the purpose of calling the function in this manner?



via Chebli Mohamed

jeudi 26 mai 2016

Looking for a WordPress Auction Ads Plugin

We want an advertisement plugin which can sell the ads by auction. To be more specific, the function would be similar to a OIO AD Manager , but different charging model (the OIO AD, and most of other ad plugin I can find has three charging model: Cost per day, Cost per click, Cost per impression). However, what we want is a charging model similar to auction, for example, if Mr.A pays more, his ads may has a better position.

I tried to searched for this plugin, but it seems that I can hardly find one. So guys,please just let me know what you think. Or please tell me how hard to write my own one. Thanks a lot.



via Chebli Mohamed

How to replace text in wordpress the_title?

I want to replace a text in wp title ,
Actually, There's a widget for popular posts.
I want to replace a text in output of this widget, So I looked around the widget functions and I found this code :

foreach($popular as $post) :
        setup_postdata($post);
        ?>
    <li>
        <a href="<?php the_permalink(); ?>">
            <?php if ( $show_thumb3 == 1 ) : ?>
                <?php the_post_thumbnail('widgetthumb',array('title' => '')); ?>
            <?php endif; ?>
            <?php the_title(); ?>   
        </a>
blah blah blah...

I've tried to change this line <?php the_title(); ?> to :

<?php
    $wptitle = the_title();
    $wptitle = str_replace('textbefore', 'textafter', $wptitle);
    echo $wptitle;
?>

But it did nothing in the live site and nothing affected at all!
How can I replace a text in the title in widget output?
How will it be possible if there are two strings that I want to replace ?
Should I use something like this ?:

    <?php
    $wptitle = the_title();
    $wptitle = str_replace('textbefore', 'textafter', $wptitle) && str_replace('text2before', 'text2after', $wptitle);
    echo $wptitle;
?>



via Chebli Mohamed

Wordpress login not working properly for custom template-page

Login is not working properly on my wordpress site. After login i am redirecting it on home page(custom template page). From that page when user click on any other page its show as not logged in even. But when you click on address bar and press enter all menu will available( which will be enable for loged in user). You can see website will show as login. When you click on other pages sometime it will show as loggedin & sometime not.

I think problem is due to custom template but not sure.

(Custom template)

http://ift.tt/1RtWW6d

(default Template)

http://ift.tt/1XVfZxN

subscriber login detail

userid - student1

pass - 123456



via Chebli Mohamed

Wordpress contact form 7 not working with Microsoft Dynamics CRM‎

We are using contact form 7 in Wordpress. I want the contact form to send data to our New Microsoft Dynamics CRM‎ through json or Api. So far I got this but it's not working can someone please help me with this. In functions.php I have inserted this:

function leads_integration_wp_cf7( $cf7 ) {
   $url = your_url_goes_here;
   $postparams = your_post_params_goes_here;

   $ch = curl_init($url);
   curl_setopt($ch, CURLOPT_POSTFIELDS, $postparams);
   curl_setopt($ch, CURLOPT_POST, 1);
   curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1 );
   curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1 );
   $output = curl_exec($ch);
   curl_close($ch);
}
add_action('wpcf7_mail_sent', 'leads_integration_wp_cf7');

and in php file I have added this:

Like I said it's not working any tip will help thank you :)



via Chebli Mohamed

How to call the ajax function in my plugin file using wordpress?

I need to call the ajax call in my plugin . I have created plugin file .

My Plugin File :-

  class Wp_MYplugin{
        function __construct() {
            add_action( 'wp_ajax_my_ajax', 'my_ajax' );
        }

        function my_ajax(){
            echo "test";
        }
   }

Ajax call returns 0 . How can I fix this ?



via Chebli Mohamed

mass mailing: loop with ajax calls freezes randomly

I have a wordpress plugin that sends up to 3,200 newsletters each week to our subscribers. However, it freezes sometimes after 800, sometimes after 1,200 mails (it's always different, there is no certain pattern). We use turbo smtp as our host.

Here's how I do it:

I loop through the rows of a table, where all the mail addresses are stored, and trigger an ajax call for each row.

// get total count of subscribers
$sqlAll = "SELECT * FROM subscribers";
$resultAll = mysql_query($sqlAll);
$numrowsAll = mysql_num_rows($resultAll);

// send mail for each subscriber, increasing row pointer $i each time
$sql = "SELECT * FROM subscribers LIMIT $i, 1";
$result = mysql_query($sql);
while ($guy = mysql_fetch_array($result)):
    $mail = new PHPMailer(); 
    $mail->Host = 'pro.turbo-smtp.com';
    .... (other smtp settings here)
    $mail->Send();

    $i ++; // increase the row pointer by 1

    // if row is NOT the last in the table, repeat this step for the next row   
    if ($i < $numrowsAll) {
echo "<script>$('#placeholder_massmailer').append($('<div>').load('massmailer.php?i=<? echo $i ?>'))</script>";    
}
endwhile;

It works perfectly, but sometimes, the $.load ajax call seams to freeze after a certain amount of ajax calls.

Should I use another architecture? Is $.post better for this? It works as part of a wordpress plugin; when it has freezed, I notice that wordpress tries so send a "heartbeat" ajax call?

thanks Matthias



via Chebli Mohamed

Wordpress Buddypress registration plugin activation link not working

I have installed wordpress buddypress registration plugin. When I register I am getting account activation link as below

http://ift.tt/20FSyrp

when I click on this link I am getting page not found error.

you can help to solve this issue



via Chebli Mohamed

Either one of Two required fields in contact form 7 validation on submit in WordPress

http://ift.tt/2492URn

I tried this but not getting proper result How to do this with contact form 7



via Chebli Mohamed

wordpress Mailgun Plugin : Mailgun API HTTP Test Failure

I am using mailgun in wordpress using wordpress mailgun plugin , I have verified domain on mailgun its active now on mailgun But When ever I Click on Test Configurartion on Wordpress mailgun plugin its gives this error "Mailgun API Http Test Failure"



via Chebli Mohamed

Wordpress Woocommerce get custom data

Hi I need to get the product id, product variation id , and custom field text from each order. Ive retrieved all except the custom field text input data. Using

 $product_description = get_post_meta($item['product_id'])->post_content

Actually crashed the site altogether whereas all other parameters work well. See snippet below.

add_action('woocommerce_payment_complete', 'custom_process_order', 10, 1);
       function custom_process_order($order_id) {
       $order = new WC_Order( $order_id );
       $myuser_id = (int)$order->user_id;
       $user_info = get_userdata($myuser_id);
$items = $order->get_items();
foreach ($items as $item) {

       $product_name = $item['name'];
       $product_id = $item['product_id'];
       $product_variation_id = $item['variation_id'];
       $product_description = get_post_meta($item['product_id'])->post_content
       }
       return $order_id;
       } 

What might I be missing.



via Chebli Mohamed

Hide the whole metabox cmb2

i'm using the famous CMB2 to create custom metaboxes, i want to have one hidden field with default value which i will set myself. i used this hidden field type and its working fine , the thing is the metabox will have this field only, so i ended up with what looks like an empty metabox which may confuse the user. i have read dispaly options but this controls where should the metabox appear, i have it exactly where i want on my posts but i want to set it's visability to be hidden so i do not confuse the user , i thought about using css on this but i want to check if there is a way to achieve this using CMB API



via Chebli Mohamed

using scripts in a WordPress plugin

I have been given a simple WordPress plugin to maintain. Looking at the code, it calls wp_enqueue_script` to include the scrips it needs.

function my_scripts() {
    wp_enqueue_script( 'jquery' );
    wp_enqueue_script( 'jquery-1', 'http://ift.tt/1rJStC0', 'jquery', false );
    wp_enqueue_script( 'jquery.validate', 'http://ift.tt/20Fk0Fz', 'jquery', false );
    wp_enqueue_style( 'bootstrap', 'http://ift.tt/1J4cr1i' );     
}

I haven't worked on WordPress plugins before and I am in the process of changing the calls to CDNs to use local files that will be included with the plugin.

I am not sure why the first 2 lines are for JQuery, as my understanding is that JQuery is available by default, so the line that references jquery-1 can be removed.

How do I make sure that WP uses the version of JQuery I want?



via Chebli Mohamed

Change default horizontal tab to vertical tab in woocommerce product detail page?

I am using woocommerce plugin for an ecommerce website. There are default horizontal tab for product information in product detail page. I want to change this order of tabs to vertical.

This is currently looking now



via Chebli Mohamed

Insert a link in a text area of a widget

I am using a WordPress theme and in widget area there is a custom widget that adds a toggle. In toggle content I tried to put a link <a href="http://mypage.com">link</a> but in page it appears like <a href="http://mypage.com">link</a> and not like link. Is there a way to fix this?



via Chebli Mohamed

Wordpress - How to trigger all routine functions and hooks after creating a new post from customized function

I am very new (actually my 1st attempt) to wordpress plugin coding part. From tutorials available on net, I created my custom function to create a new post (in this case it's also new post type - "question", which has been already made available by AnsPress plugin).

Relevant part of my function is like -

<?php
function AddQuestionToAnsPress($question_title, $question_content, $answer_content, $subject_id, $exam_id) {
    $path = $_SERVER['DOCUMENT_ROOT'];
    $path .= "/wp-blog-header.php";
    require($path);
    $question_title = strip_tags($question_title);
    $category_id = $subject_id;
    $category = array($category_id);
    $tag_subject_id = $subject_id;
    $tags = array(25, $tag_subject_id);
    wp_set_current_user(26);
    $user_id_for_question = 26;
    $question_array = array(
        'post_title' => $question_title,
        'post_author' => $user_id_for_question,
        'post_content' => $question_content,
        'post_type' => 'question',
        'post_status' => 'publish',
        'comment_status' => 'open'
    );
    $question_post_id = wp_insert_post($question_array);
    $question_permalink = get_permalink($question_post_id);
    wp_set_post_terms($question_post_id, $category, 'question_category');
    wp_set_post_terms($question_post_id, $tags, 'question_tag');

    $anspress_link = $question_permalink;
    return array('anspress_link' => $anspress_link, 'question_post_id' => $question_post_id);
}
?>

At present, this function is not added as plugin or in theme. Instead I am using it from a separate PHP file. This function does the primary work for me, i.e. to create a new post with post type "question". But, the problem is, my function is unable to trigger any other plugin (and their relevant activities) which are triggered after creating a new post.

For e.g. I have installed NextScript SNAP plugin in my wordpress blog, which autopost, to my facebook page, the newly created posts (but only when the post is created from wordpress itself).

So, how should I modify my function or what should I add to my function, so that it can auto-detect all the fucntions/hooks/filters which should be triggered soon after creating new post?



via Chebli Mohamed

Automatic Install Required Plugin

Custom Plugin Depended on Woocommerce plugin.

So if not install then In background process automatic install Woocommerce plugin.

I have found 'tgm plugin activation' for Theme plugins automatic install

Is it any way for plugin required another plugin automatic install.

Suggest me.

Thanks.



via Chebli Mohamed

mercredi 25 mai 2016

Wordpress creates plugin tables locally, not in production

I am making a plugin for a client and i am trying to install it on their test server.

When i install the plugin locally, everything works fine. However, when i install it on their test server, the tables are not created. They don't have debug turned on, and i don't get any message that there was an error installing. I verify that the tables are not created, by using a plugin called database browser.

Here is the code, that creates the table, everything else is cut out. With this code the tables are created locally:

<?php
/*
Plugin Name: Integration Rating
*/

class IntegrationRating {

    const INTEGRATIONS_TABLE_NAME = "ir_integrations";
    const RATINGS_TABLE_NAME = "ir_ratings";

    /**
     * Called when the plugin is activated. Creates the tables for the plugin.
     */
    public static function activate_plugin() {

        global $wpdb;

        $sqlCreateTable1 = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . IntegrationRating::INTEGRATIONS_TABLE_NAME . "` (
            `post_id` bigint(40) unsigned NOT NULL,
            `rating` int(11) NOT NULL,
            `num_raters` int(11) NOT NULL,
            PRIMARY KEY (`post_id`),
            CONSTRAINT `post_id` FOREIGN KEY (`post_id`) REFERENCES `" . $wpdb->prefix . "posts` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8;";

        $sqlCreateTable2 = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . IntegrationRating::RATINGS_TABLE_NAME . "` (
            `post_id` bigint(40) unsigned NOT NULL,
            `rater_email` varchar(255) NOT NULL DEFAULT '',
            `rating` int(1) NOT NULL,
            PRIMARY KEY (`post_id`,`rater_email`),
            CONSTRAINT `ratings_post_id` FOREIGN KEY (`post_id`) REFERENCES `" . $wpdb->prefix . IntegrationRating::INTEGRATIONS_TABLE_NAME . "` (`post_id`) ON DELETE CASCADE ON UPDATE CASCADE
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8;";

        $wpdb->query($sqlCreateTable1);
        $wpdb->query($sqlCreateTable2);
    }

    /**
     * Called when the plugin is uninstalled. Removes the plugins tables from the database.
     */
    public static function uninstall_plugin() {

        global $wpdb;

        $sqlDropTable1 = 'DROP TABLE IF EXISTS ' . $wpdb->prefix . IntegrationRating::INTEGRATIONS_TABLE_NAME;
        $sqlDropTable2 = 'DROP TABLE IF EXISTS ' . $wpdb->prefix . IntegrationRating::RATINGS_TABLE_NAME;

        // Delete ratings first because of constraints
        $wpdb->query($sqlDropTable2);
        $wpdb->query($sqlDropTable1);
    }

}

function ir_activate_plugin() {
    IntegrationRating::activate_plugin();
}

function ir_uninstall_plugin() {
    IntegrationRating::uninstall_plugin();
}

register_activation_hook(__FILE__, 'ir_activate_plugin');
register_uninstall_hook(__FILE__, 'ir_uninstall_plugin');

new IntegrationRating();

I'm hoping someone has some clues to what could be wrong.



via Chebli Mohamed

WordPress Theme like Gen.tech

I'm looking for a WP theme that looks like http://gen.tech

All functionalities or almost all included. Pls recommend any

Thanks



via Chebli Mohamed

Kirki - Duplicate theme page with Kirki customizer

I've purchased the BeOnePage Pro. It is a one page theme. I'm trying to create a new page named Contact and use the contact and map modules in this page from the front page. I thought I could duplicate the front page then use customizer to add/remove modules. I've duplicated the Front page using a wp plugin Duplicate Post by Enrico Battocchi and named it Contact. When i go to my new contact page I don't see any of the modules from the front page. And no modules show using the customizer. I've visited the Kirki Documentation but I am still lost. I can edit the files but again I don't know what files or code to write and I'm not getting any feedback from the theme developer. Can anyone help me create my new contact page by telling me how to do this or giving me some suggestions or pointing me in the right direction? Thanks in advance

https://kirki.org



via Chebli Mohamed

Easy fancybox image overlay

I am using the easy fancybox WordPress Plugin. Underneath the text of the image shown, there is a grey overlay, I would like this to extend to the whole image. The div class for the text is "fancybox-title-over" and the div for the image is "fancybox-img"

Lightbox Image



via Chebli Mohamed

Wordpress Plugin leaking memory

I have a website running on Wordpress. I am running the website on Amazon EC2 web servers, with t2.micro instance. (1CPU and 1GB RAM).

I have installed a few plugins and one of them is leaking memory and overloading the main memory of the system and also the swap space of the system. I am unable to determine which plugin is leaking the memory.

Is there a way to determine what wordpress plugin is leaking memory? or if anyone is familiar with plugins listed below that have cause the same problem for you?

 ubuntu@sdf:/var/www/html/wordpress/wp-content/plugins$ ls
360-product-rotation     cm-map-locations
hello.php          live-composer-page-builder   
revslider            store-locator-le        
woocommerce_events    wp-mail-smtp             
wysija-newsletters   akismet               
contact-form-7         html5-responsive-faq  
mailpoet-woocommerce-add-on      shortcodes-ultimate             
the-events-calendar      woocommerce-menu-bar-cart  
wpmandrill               yith-woocommerce-zoom-magnifier
breadcrumb-navxt      ds-live-composer    index.php             
market-360-viewer            showcase-visual-composer-addon  
Ultimate_VC_Addons   wordpress-seo              wp-post-formats-develop
breadcrumbs           flexi-pages-widget  js_composer           _notes                       
smart-product-viewer            woocommerce          wpglobus      wp-super-cache



via Chebli Mohamed

How to add div's with variables into a wordpress function?

Hey all, I'm trying to add some div's with variables into a function. I know the html needs to be wrapped, what is the best way to do this? Here is the code I'm trying to add to a function.

    function add_before_sidebar( ) { 

    <div class="acro-sidebar-preview">
        <div class="acro-sidebar">
            <div class="image-container">
                <div id="profile-picture-preview" class="profile-picture" style="background-image: url(<?php print $picture; ?>)">
        </div>
    </div>
        <h1 class="acro-username"><?php print $fullname; ?></h1>
        <h2 class="acro-description"><?php print $description; ?></h2>
    <div class="icons-wrapper">

    <?php print '<a href="' . $twitter . '"><img src="' . plugins_url( 'img/twitter.png', __FILE__ ) . '" ></a>' ?>
    <?php print '<a href="' . $facebook . '"><img src="' . plugins_url( 'img/facebook.png', __FILE__ ) . '" ></a>' ?>
    <?php print '<a href="' . $google . '"><img src="' . plugins_url( 'img/googleplus.png', __FILE__ ) . '" ></a>' ?> 

        </div>
    </div>
</div>
}
add_action( 'get_sidebar', 'add_before_siderbar' );

All of the above code is connected to this set of variables I have setup

<?php
    $picture = esc_attr( get_option('profile_picture') ); 
    $firstname = esc_attr( get_option('first_name') );
    $lastname = esc_attr( get_option('last_name') );
    $fullname = $firstname . ' ' . $lastname; 
    $description = esc_attr( get_option('user_description') ); 
    $twitter = esc_attr( get_option('twitter_handler') );
    $facebook = esc_attr( get_option('facebook_handler') );
    $google = esc_attr( get_option('google_handler') );
    ?>

The code itself works great outside of the function. I'm familiar with writing a div with variable in a function but this is a bit more complex then I'm used to. Any help would be appreciated. Thanks in advance!



via Chebli Mohamed

Woocommerce - Get discounted price within custom plugin from another woocommerce plugin

I've developed a custom plugin for wordpress / woocommerce that is essentially listing out a wishlist of products. One thing I can't work out is how to retrieve the price processed by all hooks / filters added by other plugins(Woocommerce Role pricing light).

I have role pricing light installed and would like to get the discounted price based on the user role. So programmatically get the discounted price in the context of the plugin I'm building..

Instantiating the product via WC_Product works for the single full price only.

ie:

$wooProduct = new WC_Product( $val->product_id );
$price = $wooProduct->get_price();
//^^ the above price is wrong and not discounted.

In context of what I'm building:

    // Loop over products / Populate with quantity 0 if no quantity or entry found on existing product.
    foreach ($products as $key => $val) {

        $wooProduct = new WC_Product( $val->product_id );

        $price = $wooProduct->get_price();
        //$price is wrong here and not discounted by role pricing light

        $name = $wooProduct->post->post_title;
        $id = $wooProduct->post->ID;
        $url = get_permalink ($id);

        $tmpProducts [] = array(
            "product_id"=>$val->product_id,
            "item_id"=> isset($userOrderProducts[$val->product_id]["item_id"]) ? $userOrderProducts[$val->product_id]["item_id"] : NULL,
            "title" => $wooProduct->post->post_title,
            "url" => get_permalink ($id),
            "price" => $wooProduct->get_price(),
            "qty" => isset($userOrderProducts[$val->product_id]["quantity"]) ? intVal($userOrderProducts[$val->product_id]["quantity"]) : 0,
        );
    }



via Chebli Mohamed

mardi 24 mai 2016

Problems with buttons after Wordpress update/ Plugin update

I don't have so much experience. I can't use anymore these 3 buttons (the problem appeared after plugins update / wordpress update) enter image description here

Initially i could click those 3 buttons and open like the first button to the left and the image would change. None of these happens now.

Could someone help me fix this ?



via Chebli Mohamed

CF7 Wordpress Message Popup error

I have a form which is showing the requested content cannot be loaded. please try again later. as a popup when submitted. I do not have a clue what is causing this error. I am new to wordpress.

Everything seems perfect. I am using CF7 Response Message Popup plugin.



via Chebli Mohamed

WordPress Custom Form submit data view on admin panel?

I am a new boy on WordPress.I created a custom form on my site with 2 fields and a submit button.Pls take a look my form.

<div class="control-group">
  <label class="control-label"  for="name">Name</label>
  <div class="controls">
    <input type="text" name="name" placeholder="Your Name" class="form-control">
  </div>
</div>
<div class="control-group">
  <label class="control-label" for="number">Mobile</label>
  <div class="controls">
     <input type="number" name="number" placeholder="017xxxxxxxx" class="form-control">
   </div>
</div>
<button type="submit" value="sub" name="sub" class="btn btn-success btn-block btn-sm marTop15">Submit!</button> 

I want when site visitor submit those form, show submitted data on my WordPress admin panel.And i can delete those data from admin panel.

Pls see this image i want to make like this. admin panel view

So how can i do this without any plugins.thx



via Chebli Mohamed

How to use custom theme with plugin in wordpress

I have developed a custom plugin in wordpress. I want to change the look and feel of the plugin. Please tell me how can i use custom theme with the plugin. This plugin should not conflict with wordpress main theme css files.



via Chebli Mohamed

How to applied css to woocommerce plugin?

I am using woocommerce plugin in one of my ecommerce website. I am changing some css in my filter box. But when i am applying css to the file it is not showing any changes. I inspect element in browser and when i changed there in css, it is showing changes. Where i went wrong. I just changes here to add border to filter divs but it is not showing any changes. Url of my website is http://ift.tt/1Tx0c8C

.prdctfltr_columns_3 .prdctfltr_filter {
        width:30%;
        border: solid 1px #f0f0f0;
}



via Chebli Mohamed

Wordpress - Plugin to allow visitors to send PDF & pay through paypal?

So I have a wordpress website where I offer services.

I want visitors to be able to send a PDF to my email and also pay through paypal.

Is there an easy way to do this? Any plugins?



via Chebli Mohamed

custom Form submitted data view on wordpress admin panel

I created a custom form on my site.When visitor submit those form.I can review visitors submitted data on WordPress admin panel.

<div class="modal-body"> 
   <h3>Get Appointment <?php the_title(); ?></h3>
   <div class="control-group">
      <label class="control-label"  for="name">Name</label>
      <div class="controls">
         <input type="text" name="name" placeholder="Your Name" class="form-control">
      </div>
    </div>
    <div class="control-group">
      <label class="control-label" for="number">Mobile</label>
      <div class="controls">
         <input type="number" name="number" placeholder="017xxxxxxxx" class="form-control">
      </div>
    </div>
    <button type="submit" value="sub" name="sub" class="btn btn-success btn-block btn-sm marTop15">Submit!</button>       
</div>

So how can i do it without plugin or with plugins. thanks



via Chebli Mohamed

Wordpress how to server all static files under wp-includes from a subdomain?

how to server all static files under wp-includes from a sub domain ? Right now if the site is www.example.com then the static files are from http://ift.tt/1YVhA5c... Want it from http://ift.tt/1XtQvai... I guess its an update from wp-options table ? Any experience ?



via Chebli Mohamed

How to change the price of all the products with a constant variable according the weight of the products in wordpress?

I want to change the price of the products according to the weight with a variable amount. Such as silver, as the price changes on day to day basis so the price will be calculated with the amount I insert for 1gm silver. For example, a product is of 300gm and the price for 1 gm silver is 2000 bucks then 300*2000 = 600,000 bucks. The silver price will change daily and the price will be calculated according to that for all the products. Is there any plugin available for that or if it is possible with some code change I can do that. Help me out with this issue. Thanks



via Chebli Mohamed

Woocommerce not passing required fields on guest checkout

Somehow Woocommerce messed up the guest checkout at a client's website. It keeps saying that fields are required, though everything is filled in as should. I double checked if the page was being cached, but that was not the case. I am not using any checkout plugins and WC is up to date, so that is also not the problem. However it does work when the user is logged in, so it must have something to do with permissions. Does anyone know what causes this and how to fix it?

The website of my client is rubberdeal.com and is in Dutch. When you order you can see the issue (as the form is not passing the required fields check).

Thanks in advance.



via Chebli Mohamed

Wordpress meta query returning same results when checkbox value checked

I am creating a custom plugins which has the ability to search users according to their meta values. Everything is perfect except the part when the checkbox query is checked. If i check the checkbox the query returns 3 same results. The search is working fine as I am getting the desired result but 3 times. Here is my code tried so far.

$users = new WP_User_Query( array(
'search'         => "*{$pem}*",
'search_columns' => array(
    'user_email',
),
'meta_query' => array(
    'relation' => 'AND',
    array(
        'key'     => 'first_name',
        'value'   => $fname,
        'compare' => '='
    ),
    array(
        'key'     => 'last_name',
        'value'   => $lname,
        'compare' => '='
    ),
    array(
        'key'     => 'min_salary',
        'value'   => $salary_min,
        'compare' => '='
    ),
    array(
        'key'     => 'empl',
        'value'   => $status,
        'compare' => '='
    ),
    array(
        'key'     => 'min_hrly',
        'value'   => $salary_hourly,
        'compare' => '='
    ),
    array(
        'key'     => 'years_work',
        'value'   => $years_work,
        'compare' => '='
    ),
    array(
        'key'     => 'years_non',
        'value'   => $years_non,
        'compare' => '='
    ),
    array(
        'key'     => 'expert_work',
        'value'   => $expert_work,
        'compare' => '='
    ),
    array(
        'key'     => 'a_city',
        'value'   => $addr['city'],
        'compare' => '='
    ),
    array(
        'key'     => 'a_state',
        'value'   => $addr['stt'],
        'compare' => '='
    ),
    array(
        'key'     => 'a_zip',
        'value'   => $addr['zip'],
        'compare' => '='
    ),array(
        'key'     => 'startday',
        'value'   => $startdate['day'],
        'compare' => '='
    ),
    array(
        'key'     => 'startmonth',
        'value'   => $startdate['month'],
        'compare' => '='
    ),
    array(
        'key'     => 'startyear',
        'value'   => $startdate['year'],
        'compare' => '='
    ),
    array(
        'key'     => 'hdeg',
        'value'   => $education,
        'compare' => '='
    ),
    array(
        'key'     => 'sekj',
        'value'   => $position1,
        'compare' => '='
    ),
    array(
        'key'     => 'seekk',
        'value'   => $position2,
        'compare' => '='
    ),
    array(
        'key'     => 'checkbox',
        'value'   => $expert['a'],
        'compare' => 'LIKE'
    ),
)
) );
$users_found = $users->get_results();

This problem only arise when I add query for checkbox else everything is working good.

Am I missing something?

enter image description here



via Chebli Mohamed