Posted: February 3, 2015 at 4:26 pm
|
Hello: |
|
Forgot to add: |
|
Hi, 2 ways: 1) Edit the template files to edit/remove the code. This thread has a discussion about it https://eventespresso.com/topic/removing-register-linkview-details-just-add-to-cart-link/ 2) Use CSS and the language files to hide the button and ” or ” from the webpage. |
|
Thanks. |
Hi Anne, You can add this function to your theme function.php file or a site specific plugin: https://gist.github.com/Pebblo/9772609552259e625a02 That will ‘translate’ the ‘ or ‘ phrase to ” (nothing). Here is how it looks with the register button still in place – http://take.ms/scfWF |
|
|
Thanks Tony. |
|
Looking at the thread referred to above, there are a number of issues in the discussion. Could you provide just the instructions for modifying the php to show only “Add to Cart”/”View Cart”? |
Yes and no. That code will only look for a string that is passed to __() or _e() and looks specifically for ‘ or ‘, here is the code within the event list that outputs that string: 'separator' => __(" or ", 'event_espresso') So unless you have another string, such as: $somevar = __(" or ", 'some_domain') Then the only ‘ or ‘ that will be replaced it the one within EE. If you are comfortable editing template files I can provide details on how to do that if you prefer? |
|
Also to note, that code would NOT translate a string such as – ‘You can do it this way or that way’ because the full string must match exactly. Translating ‘ or ‘ does not translate that string within other strings. |
|
|
Tony: |
Hi Anne, Could you try Tony’s sample code along with this line of CSS in your theme’s stylesheet? .a_register_link.ui-button.ui-button-big.ui-priority-primary.ui-state-default.ui-state-hover.ui-state-focus.ui-corner-all {display: none;} That should hide the button and remove the “or.” http://cl.ly/image/3P180M0t1622 — |
|
If you developers are familiar with EE this should be fairly straight forward. Within event-espresso/templates/ you will find event_list.php and event_list_display.php Copy both of those fiel to wp-content/uploads/espresso/templates/ This will keep the modifications you made safe from updates, when editing template, upload them to this location. So then open the event_list_display.php file. Around line 137 you will find: 'separator' => __(" or ", 'event_espresso') Either remove or comment out that line, personally I would comment it out like so: //'separator' => __(" or ", 'event_espresso') That will remove the ‘ or ‘ string from the cart link on that page. Also on line 152 you should find the output for the register now button, you could also remove that link, it will be the one above this: Or you can continue to do that with CSS if you prefer. Hope that helps 🙂 |
|
|
Lorenzo: |
|
Tony: |
|
Relatedly, I’ve been using this code to create a link to the EE shopping cart: Also, is it possible to: Thanks. |
|
Oops, the code was parsed into a link. Let’s try this: |
|
Tony: |
That link is displayed when you set the ‘Display Registration form’ to No within an event, so it depends if you will be using that feature or not. /event-registration-current-events/?regevent_action=show_shopping_cart That link should work fine, looking at the above it seems you have changed the default EE page slug? (It is fine to do so, just checking)
Both of these features are not available within EE and as you are using your own custom links you’ll need to check the session and see if any events are within. I would recommend looking at the code for the ‘Cart widget’ available within the MER Add-on, this has something like: if (empty($_SESSION['espresso_session']['events_in_session'])){return;} You could set a flag using that code, then wrap your links within a check for that flag and only display the links it true. The ‘Add To Cart’ link should change to a ‘View Cart’ link when the event is added to the cart, is that not what you are looking for? |
|
|
I’m not sure what that is for – does it disable the capability for someone to change the name associated with the event registration? |
|
I just hard coded the link to cart – copied it from an event. When you mention a slug, are you referring to a shortcode? Is so, Where do I find it? |
|
Is there a setting so that when an event is added to a cart, the number of attendees in the cart is set to 1? It defaults to 0. |
If you edit one of your events, then look in the options on the right, you’ll see this – http://take.ms/fnuML When that is set to Yes, the event will display the registration form – http://take.ms/TPF8t When set to no, only the description is included – http://take.ms/iFXUs So at the same time, the event list will display ‘Register Now’ if that setting is set to Yes, and ‘View Details’ if set to no – http://take.ms/SFP93
This /event-registration-current-events/ is the page slug, the slug is what is used in the URL and is what your users see in the address bar. You’ll find this in the permalink structure when editing the page – http://take.ms/Be4Bh You can also change this from the ‘Pages’ view in WP.
There is not setting to allow this, but it can be done using the information in this thread: https://eventespresso.com/topic/cart-ticket-dropdown-defaults-to-0/ |
|
The support post ‘Use Cart Only for Registration?’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.