Forum Replies Created
- AuthorPosts
- thiemann.kParticipant
the checkbox for the newsletter is displayed correctly on the standard register page (/wp-signup.php).
Image: https://ibb.co/b368hVsThe checkbox is active in the MailPoet settings.
Image: https://ibb.co/DVdQ47zBut unfortunately I don’t get this implemented in the registry by WcfM
This is the original code from mailpoet/lib/subscription/registration.php
<?php namespace MailPoet\Subscription; use MailPoet\Settings\SettingsController; use MailPoet\Subscribers\SubscriberActions; use MailPoet\WP\Functions as WPFunctions; class Registration { /** @var SettingsController */ private $settings; /** @var SubscriberActions */ private $subscriber_actions; function __construct( SettingsController $settings, SubscriberActions $subscriber_actions ) { $this->settings = $settings; $this->subscriber_actions = $subscriber_actions; } function extendForm() { $label = $this->settings->get( 'subscribe.on_register.label', WPFunctions::get()->__('Yes, please add me to your mailing list.', 'mailpoet') ); print '<p class="registration-form-mailpoet"> <label for="mailpoet_subscribe_on_register"> <input type="checkbox" id="mailpoet_subscribe_on_register" value="1" name="mailpoet[subscribe_on_register]" /> ' . esc_attr($label) . ' </label> </p>'; } function onMultiSiteRegister($result) { if (empty($result['errors']->errors)) { if ( isset($_POST['mailpoet']['subscribe_on_register']) && (bool)$_POST['mailpoet']['subscribe_on_register'] === true ) { $this->subscribeNewUser( $result['user_name'], $result['user_email'] ); } } return $result; } function onRegister( $errors, $user_login, $user_email = null ) { if ( empty($errors->errors) && isset($_POST['mailpoet']['subscribe_on_register']) && (bool)$_POST['mailpoet']['subscribe_on_register'] === true ) { $this->subscribeNewUser( $user_login, $user_email ); } return $errors; } private function subscribeNewUser($name, $email) { $segment_ids = $this->settings->get( 'subscribe.on_register.segments', [] ); if (!empty($segment_ids)) { $this->subscriber_actions->subscribe( [ 'email' => $email, 'first_name' => $name, ], $segment_ids ); } } }
I tried to use parts of it … the checkbox is shown, but it doesn’t work.
// Display a custom checkbox in My Account > Account details add_action( 'woocommerce_register_form', 'add_account_newsletter_checkbox_field' ); add_action( 'woocommerce_edit_account_form', 'add_account_newsletter_checkbox_field' ); function add_account_newsletter_checkbox_field() { print '<p class="registration-form-mailpoet"> <label for="mailpoet_subscribe_on_register"> <input type="checkbox" id="mailpoet_subscribe_on_register" value="1" name="mailpoet[subscribe_on_register]" /> ' . esc_attr($label) . ' </label> </p>';
thiemann.kParticipantHey Molay Das, thanks for your answer! Thats really simple…
I totally forgot about this function ..
but the problem I still have is that I can’t get Mailpoet involved there …
a checkbox yes, but not in combination with our newsletter pluginThanks, Karsten
thiemann.kParticipantHey, tanks for your answer.
I take an screenshot from our installed plugins.
I do not understand myself what’s going on at the moment
Thanks, Karsten
thiemann.kParticipantThis reply has been marked as private.thiemann.kParticipantWCFM = Version 6.3.2
WCFM = Version 3.2.4
thiemann.kParticipantno, not really. In any case, your editor differs (and looks for the toolbar) from the original. can you maybe show me two screenshots? (woocoomerce create product editor & wcfm create product editor)
Ciao, Karsten
thiemann.kParticipantwith the last picture, I get it probably that the file, which can be uploaded in the backend, can be downloaded in the frontend. but actually this plugin does something completely different: it replaces the product image with the model file … so it would be nice if it could be applied the same way
thiemann.kParticipantplease excuse the wait;)
what code do you use to create a Metabox?
There is still another plugin, which I would like to have in a meta box, but which should only be displayed in the backendthiemann.kParticipantSorry, but I can not get it somehow. I tried some variations, but it just does not work …
thiemann.kParticipantThis reply has been marked as private.thiemann.kParticipantFor example: Can I choose them from dropdown?
Again, you can adjust the class.
might be enough if you use “display: inline”.
But I do not know how this affects the rest, because it is untested.maybe here wclovers will have another / better suggestion
Ciao,
Karstenthiemann.kParticipantIs there any (easy)way to remove these things (see the pic):
Here I went into a similar topic … I link so I save the pictures;)
add_action('wp_head', 'add_css_head'); function add_css_head() { if( current_user_can('wcfm_vendor') ) { ?> <style> span.wcfmfa.fa-chalkboard {visibility:hidden} span.wcfm-page-heading-text {visibility:hidden} span.wcfm_menu_toggler.wcfma.fa-bars.text_tip {visibility:hidden} //etc... </style> <?php } }
should work 😉
Ciao,
Karsten – dein-3d.comthiemann.kParticipantit works exactly as I wrote you in your other post;)
can you show me a screenshot?
then I can also create a code for you.ciao
Karsten – dein-3d.comthiemann.kParticipantokay, i used now {visibility:hidden}
but the Header “business visibility setup” remains visible, because it is not assigned to a separate class.
With this code I hide the options. (ONLY FOR THE MEMBERSCHIP “wcfm_vendor”)
add_action('wp_head', 'add_css_head'); function add_css_head() { if( current_user_can('wcfm_vendor') ) { ?> <style> div.store_address.store_visibility_wrap {visibility:hidden} </style> <?php } }
ciao,
Karsten – dein-3d.comthiemann.kParticipantHey nict,
i solved that with a snippet, that modified the css, if a specific user role is logged on.
the easiest way to know which “class” is needed is with Chrome Inspector.
do you want to hide all settings, or only certain?
Hide all = https://ibb.co/WFHDMDj
Hide certain Block = https://ibb.co/nPYDt30
Hide associated checkbox = https://ibb.co/YjgSGGHAnd now my custom snippet-code:
add_action('wp_head', 'add_css_head'); function add_css_head() { if( current_user_can('wcfm_vendor') ) { ?> <style> // YOUR CUSTOM CSS CODE HERE // FOR EXAMPLE TO HIDE ALL div.store_address.store_visibility_wrap {display:none} </style> <?php } }
thiemann.kParticipantThank you! The problem has been solved!
Best regards!
Karsten – dein-3d.comthiemann.kParticipantIs this a “multi-site” setup?
no not really ….
We have created a test environment for our programmer to “practice” on.
Here the admin also has full right (article set, edit, etc ..)
But not on the main domain…Can there be a conflict with the license key?
thiemann.kParticipantis there any way to fix this via sql?
i had the advanced access manager installed because i had to clone a user role.
but I was not taken in my account. The plugin I have deleted again, now I can add as admin no more products.
I do not know if it has anything to do with it.
in which table are the user settings saved?thiemann.kParticipantnot yet. is that necessary?
Thanks!
thiemann.kParticipanthey =)
yes, I have already implemented that.
there are some plugins that implement that … which I like the most is the Add product frontend by NSThemes.Maybe you can offer something like that in the future? I think that is a good thing.
A customer is looking for a product that is not yet available in the shop, this can create its own product (Add User Product)
YES !
And now, when a customer has create his own product, than all vendors should be an notification/or email (maybe both).
but how does it continue?
a snippet should certainly implement this.
but how?thiemann.kParticipantExcellent! THANK YOU
…. it can be so easy sometimes
thiemann.kParticipantno, I do not want to =)
So:
I have a category where users can create “product requests”.
A customer is looking for a product that is not yet available in the shop, this can create its own product (Add User Product)
The user product automatically comes in a specified category (cat-id = “228”)
Now I would like an email / referrals (preferably both) to be sent to all sellers when a new product is created in this category.thiemann.kParticipantunder account details on the right side, new links should be created
I have solved this with this code
add_filter ( 'woocommerce_account_menu_items', 'misha_one_more_link' ); function misha_one_more_link( $menu_links ){ // we will hook "anyuniquetext123" later $new = array( 'anyuniquetext123' => 'YOUR TITLE' ); // or in case you need 2 links // $new = array( 'link1' => 'Link 1', 'link2' => 'Link 2' ); // array_slice() is good when you want to add an element between the other ones $menu_links = array_slice( $menu_links, 0, 1, true ) + $new + array_slice( $menu_links, 1, NULL, true ); return $menu_links; } add_filter( 'woocommerce_get_endpoint_url', 'misha_hook_endpoint', 10, 4 ); function misha_hook_endpoint( $url, $endpoint, $value, $permalink ){ if( $endpoint === 'anyuniquetext123' ) { // ok, here is the place for your custom URL, it could be external $url = 'YOUR URL'; } return $url; }
thiemann.kParticipantUnfortunately, it is always the last message displayed … can not somehow change that? So that all respond to each other?
thiemann.kParticipantHey 😉
Yes, please add these function!
Do you want to use this shipping services?
Yes, i would like to use this shipping services.
Unfortunately, I can not specify which shipping services must be used.
This must remain a free decision of the seller.
Some sellers have contracts with shipping services. That would not be good if we just limited ourselves to one service provider.Thanks!
- AuthorPosts