Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › eStore settings disappeared after hours of functional use (I modified some code)
- This topic has 10 replies, 2 voices, and was last updated 12 years, 2 months ago by admin.
-
AuthorPosts
-
September 8, 2012 at 5:23 am #7355smallatomMember
I installed eStore yesterday without a hitch. I’ve been configuring it all day and it’s been working brilliantly. All of the sudden, out of the blue the plugin is no longer listed in the settings panel. Also, when I hit the settings link on the plugins page, it gives me the dreaded “You do not have sufficient permissions to access this page”. I’ve searched the forum and found other people that seamed to have a similar issue, but none were exactly like mine. My URL’s don’t seem to be stripped, my plugins haven’t changed, etc. I was literally in the middle of watching a tutorial and creating a thank you page when it completely disappeared! An hour earlier I had it integrating with paypal and playing nice. Any ideas? I’m stumped and desperately in need of a resolution.
Thanks.
September 8, 2012 at 5:25 am #49102smallatomMemberAlso, this is the url I get with the error /wp-admin/admin.php?page=wp_eStore_settings
September 8, 2012 at 6:42 am #49103smallatomMemberOK, I just fixed it randomly. I realized that a couple hours before it stopped working, that I had modified the wp_eStore1.php so that the widget would hide the cart until items where put in it.
It ended up looking like this:
}
if (!digi_cart_not_empty())
{
return;
}
function show_wp_digi_cart_widget($args)
{
Everything worked well for a while and then the plugin just disappeared. I just got rid of the new code and everything is working well now. Did I make a mistake with the code, or is it something else? I’d love to be able to hide the cart in the widget.
Thanks
September 9, 2012 at 12:02 am #49104adminKeymasterThis would happen if you make a mistake in your code. You don’t need to change any code to do what you are after.
Do the following to add a shopping cart widget which only shows the cart when there is something in it:
1) Add a standard WordPress text widget to your sidebar
2) Place the following shortcode in this text widget:
[wp_eStore_cart_when_not_empty]
That should do it.
All the available shortcodes are listed here:
http://www.tipsandtricks-hq.com/ecommerce/wp-estore-shortcodes-and-functions-reference-460
September 13, 2012 at 11:07 pm #49105smallatomMemberThanks for the tip. That certainly works but unfortunately it’s falling short in 2 places for me. Hopefully you can point me in the right direction.
I’ve fixed the code with your included widget and it disappears like it’s supposed too, but I need many more just like it so I tried the shortcode you mentioned in a text widget. The problem with this is that if I title the widget “Your Cart”, the title still comes up with no cart underneath. This kind of defeats the purpose for me. Your included widget had a title that was hidden perfectly. Also, if I make a text widget with no title, it includes an extra space above it (from where the title would be). This looks a little strange and unformatted on my site.
So, I’d really love to have a bunch of widgets exactly like the one you included. Is this possible? Or am I able to duplicate your widget somehow?
Thanks!
September 14, 2012 at 1:38 am #49106adminKeymasterAdd a test widget (don’t specify any title for this widget… you can leave the title for a text widget empty). Now, in the widget content area enter the shortcode and that should do it.
September 14, 2012 at 2:54 am #49107smallatomMemberThanks, but unfortunately that’s what I did already. It leaves a space above the widget where the title would go. Also, I like having the title appear so that it says “Your Cart” or something. So is there no way to get rid of the space or add a title to the widget (that is also hidden) like in your widget? Again, if it can’t be done…is there a way to duplicate your widget? The one widget that came with the plugin is great and seams to do 2 things that the text widget cannot do…it would be great to be able to use many of them.
Thanks.
September 17, 2012 at 5:55 pm #49108smallatomMemberAny ideas on this?
September 18, 2012 at 4:12 am #49109adminKeymasterUse the following PHP code in your PHP code widget:
<?php
if (digi_cart_not_empty())
{
$output = "<h3>Your Shopping Cart</h3>";
$output .= eStore_shopping_cart_multiple_gateway();
return $output;
}
?>September 18, 2012 at 8:15 am #49110smallatomMemberThanks, I tried that with the php code widget found here [http://wordpress.org/extend/plugins/php-code-widget/]
It just came up as code in my sidebar unfortunately. Is this the php widget you recommend? I just past that in the text field, correct?
September 19, 2012 at 12:25 am #49111adminKeymasterPHP code should always be placed inside the PHP tags (
<?php and ?>
). I have updated the above code snippet example which should help you see what I mean. -
AuthorPosts
- You must be logged in to reply to this topic.