There are NO Zencart plugins on the website.
All the actual product pages are working fine.
(Side note: I’m going to sort out the SSL certificate)
Any help appreciated! My first thought was it is a phishing page and we’ve been hacked? I’ve asked the hosting tech support for help but they are unlikely to respond on the weekend.
Thanks!
]]>I initially looked at running Zencart on the same domain and this will work but the amount of additional work involved makes it a massive task and my end user will not have the savvy to use it themselves.
I reckon there is a simple obvious answer but i’m not seeing it!
]]>If you are interested integrating Zen Cart and WordPress, it’s probably because you want to mention the products from your Zen Cart store in your WordPress blog. Wouldn’t it be nice to be able to put links to your products into the relevant blog posts and pages? Wouldn’t it be nice to have the ability to display your New or Featured Products on the home page of your WordPress blog and have those listings update automatically as your Zen Cart store changes?
Zen Cart? for WordPress (zen4wp) makes integration of Zen Cart and WordPress easier than ever.
Basically, Zen4WP is a WordPress plugin that can be used to integrate Zen Cart INSIDE WordPress so that shopowners can display Zen Cart content DIRECTLY on their WordPress site via a series of widgets and shortcodes (shortcodes are a Premium Feature).
“Zen Cart for WordPress (zen4wp)” is now available in the WordPress plugin repo..
]]>I need to move the website “/public_html/forum”
into the folder “/public_html/zenpress/”
I have multiple sites within this directory that all need to be accessed with the same login/cookie tracking as the wordpress site at “/public_html/forum”.
The main reason for this is that I have a zen-cart installation in “/public_html/zenpress/cart” that is very important. I want people to be able to browse the whole site, and not lose their shopping cart contents when they leave “/public_html/zenpress/cart”
(I realize that the cart’s cookie keeps records for 24 minutes, but I was thinking it would be best to have the same cookie/login throughout the site.
*Note- I don’t want it to be necessary for someone to login at all, but if I choose to add that function for any reason, I want to only have to add it in the wordpress @ /public_html/forum and it will give access to all sites within that directory.
Also important- but less urgent: I also need to update the search bar so that it includes all the sites and add a cart image to the header so I can link it to a cart.
Thank you!
PS:
I’ve been using information from:
https://michaelwender.com/blog/2010/10/28/integrating-wordpress-and-zencart/
So far everything works fairly well, but I’m not sure what to do about the part titled:
Zen Cart Compatibility Functions for your WordPress Theme’s functions.php
–the author says to add the following code but I’m not sure where to add it:
define(‘ZENCART_DIRECTORY’,’products’); // name of the directory in which ZenCart is installed
// START ZenCart Functions
/*
* updateShoppingCart() – inserts/updates a WPDB copy of the ZenCart shopping cart
*/
function updateShoppingCart(){
global $wpdb;
$cart = $_SESSION[‘cart’];
$qty = 0;
foreach($cart->contents as $item){
$qty = $qty + $item[‘qty’];
}
if($wpdb->get_var(‘SHOW TABLES LIKE “‘ .$wpdb->prefix. ‘zen_cart”‘) != $wpdb->prefix.’zen_cart’) {
$sql = “CREATE TABLE ” .$wpdb->prefix. “zen_cart (
id INT( 11 ) UNSIGNED NOT NULL ,
qty INT( 11 ) UNSIGNED NOT NULL ,
total DECIMAL( 10, 2 ) NOT NULL ,
zenid VARCHAR (64) NOT NULL ,
time timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
PRIMARY KEY ( id )
) ENGINE = MYISAM”;
$wpdb->query($sql);
}
if(!empty($cart->cartID)){
$cart_id = $wpdb->get_var(‘SELECT id FROM ‘ .$wpdb->prefix. ‘zen_cart WHERE id=’ .$cart->cartID);
if($cart_id != $cart->cartID){
$sql = ‘INSERT INTO ‘ .$wpdb->prefix. ‘zen_cart VALUES (‘.$cart->cartID.’,’.$qty.’,”‘.sprintf(‘%.2f’,$cart->total).'”,”‘.$_COOKIE[‘zenid’].'”,”‘ .current_time(‘mysql’).'”)’;
} else {
$sql = ‘UPDATE ‘ .$wpdb->prefix. ‘zen_cart
SET qty=’.$qty.’,total=”‘.sprintf(‘%.2f’,$cart->total).'”,zenid=”‘.$_COOKIE[‘zenid’].'”,time=”‘ .current_time(‘mysql’).'” WHERE id=’.$cart->cartID;
}
$wpdb->query($sql);
}
}
/*
* getShoppingCart() – retrieves the WPDB copy of the user’s ZenCart shopping cart
*/
function getShoppingCart(){
global $wpdb;
cleanShoppingCarts();
if(isset($_COOKIE[‘zenid’])){
$cart_row = $wpdb->get_row(‘SELECT qty,total FROM ‘.$wpdb->prefix.’zen_cart WHERE zenid=”‘.$_COOKIE[‘zenid’].'” ORDER BY time DESC’, ARRAY_A);
if($cart_row){
return $cart_row;
} else {
return false;
}
} else {
return false;
}
}
/*
* cleanShoppingCarts() – deletes WPDB copies of ZenCart shopping carts older than 900s
*/
function cleanShoppingCarts(){
global $wpdb;
$calculation = ‘TIMESTAMPDIFF(SECOND,time,”‘ .current_time(‘mysql’).'”)’;
$comparison = $calculation. ‘ > 900’;
$sql = ‘SELECT id FROM ‘.$wpdb->prefix.’zen_cart WHERE (‘ .$comparison. ‘)’;
$old_carts = $wpdb->get_results($sql);
foreach($old_carts as $old_cart){
$wpdb->query(‘DELETE FROM ‘.$wpdb->prefix.’zen_cart WHERE id=’ .$old_cart->id);
}
}
/*
* empty_wp_zencart() – deletes a WPDB copy of a ZenCart shopping cart
*/
function empty_wp_zencart($zenid){
global $wpdb;
$wpdb->query(‘DELETE FROM ‘.$wpdb->prefix.’zen_cart WHERE zenid=”‘.$wpdb->escape($zenid).'”‘);
}
// END ZenCart Functions
I did this: Installed WordPress SEO to our test site (which is WP 3.1 on Zencart; our live site is WP 3.4 on Zencart, using the WOZ theme), following the directions on the WordPress SEO pages. I then went to the WordPress admin panels, activated the plugin, and went to its settings.
Having run into some issues, I disabled all other plugins (but can’t see a way to get to the default WordPress theme from the WOZ theme) and this doesn’t make a difference to the problems.
Using the test site requires a HOSTS file edit.
I expected the plugin to do this: Show its settings so I could explore it.
Instead it did this: Many of the WordPress SEO functions don’t appear, and Quick Edit of posts doesn’t work. For example, in the Titles and Metas settings, the tabs appear but are empty.
In the Posts list, Quick Edit is unresponsive, Edit launches a post slowly, and the WordPress SEO section header appears, but with no contents. The down arrow appears on the right but is unresponsive.
Disabling the WordPress SEO plugin immediately re-activates Quick Edit.
Additionally, the test site seems slower with the WordPress SEO plugin activated; the WordPress posting functions are definitely slower.
I’m wondering if there is an issue because of the way that WordPress on Zencart moves the WordPress folders up from the root? I’ve run into this before with media players.
Regards,
Patrick Keenan
https://www.ads-software.com/extend/plugins/wordpress-seo/
]]>I found a plug-in called WordPress_ZenCart_Listing, although it doesn’t seem to be maintained. Although I get errors with the widgets, I can get the shortcode version to work. The problem is, any text that is above the shortcode, shows up below it–no matter if the shortcode is placed on a page, post, or sidebar widget. So for example, in a sidebar widget, the heading for it shows up underneath my zencart products instead of above.
I found this thread that shows code that might fix it:
function sample_shortcode() {
ob_start();
include 'sample_shortcode.php';
$result = ob_get_contents();
ob_end_clean();
return $result;
}
add_shortcode('sample_shortcode', 'sample_shortcode');
The person said “Put it in your plugin code and put the sample_shortcode.php in the same directory. (Best to put your plugin in its own folder inside plugin folder.”
I don’t know what is meant buy the sample_shortcode.php
Is this a file that I create? & What goes into it? Also, exactly where in my plugin code do I put the above code?
Or, if someone has any suggestions on how to get zencart new products or featured products to show up in my sidebar, I’m all ears! Another person was successful using the zencart single_sidebox.php on her blog and tried to help me, but we couldn’t figure out why it wouldn’t work. I hired someone to help me, but their solution wasn’t good.
I’m hesitant to use this plugin I found since it looks like their site isn’t being maintained, but I’m at a loss for what else to do.
]]>I am using a Zen Cart add-on called Sideboxes Anywhere..
Following these instructions I was successfully able to display the new products sidebox by adding the following code to my template.
<?php
$zcSBmodule = 'whats_new.php';
$zcSBlayout = 'left';
require ("/path/to/zencart/single_sidebox.php");
?>
This is great except I would like to display the sidebox inside a widget, and I have been unsuccessful thus far.
I have tried using the Executable PHP widget with no luck. When I add the code above, all the widgets in the sidebar disappear along with the footer.
I also tried creating my own custom widget with the following code:
<?php
/*
Plugin Name: Zen Cart Whats New Sidebox
Plugin URI: https://www.yoursite.com/
Description: Display Zen Cart Whats New sidebox inside a WordPress widget. Requires the Zen Cart Sideboxes Anywhere add-on to work.
Author: Me
Version: 1.0
Author URI: https://www.yoursite.com/
*/
function zen_cat() {
$zcSBmodule = 'whats_new.php';
$zcSBlayout = 'left';
require ("/path/to/zencart/single_sidebox.php");
}
function init_zen_cat(){
register_sidebar_widget("ZC Whats New Sidebox", "zen_cat");
}
add_action("plugins_loaded", "init_zen_cat");
?>
This too results in the all the widgets in the sidebar & the footer disappearing.
I am hoping that the solution is something simple that I am overlooking.. Would sure appreciate some input on this from any kind soul who can help..
]]>