Jump to content

Multi Part Components


jthornton

Recommended Posts

CubeCart can't do this out of the box, but the "Product Addons" module adds this functionality.
https://www.cubecart.com/extensions/plugins/product-addons-easily-purchase-related-products

Every product is a product in it's own right. you can associate products to essentially build part kits. I do plan on adding a "part kit" feature to make this easier in the future, IE, create a new product in CubeCart and configure which other products are included. When buying this one product it will add all the kit items to your cart.

You can download/install and try the module out in Demo mode.

 

Link to comment
Share on other sites

I'm trying to install this and the instructions say to

Quote

FIND THE FOLLOWING CODE IN THE content.product.php file in the foundation skin

I don't see a product.php file and when I grep for some of the code I get this:

sudo grep -irl 'LANG.catalogue.add_to_basket' *
[sudo] password for john: 
modules/plugins/product_addons/CubeCart 6 foundation skin sample code.txt
modules/plugins/product_addons/skin/admin/index.tpl
skins/foundation/templates/element.product.call_to_action.php
skins/foundation/templates/content.category.php
skins/foundation/templates/content.homepage.php
skins/foundation/templates/content.certificates.php

Also your video very briefly mentions something about a store skin inversion 51custom hook is required. I have no clue what that means.

 

JT

Edited by jthornton
Link to comment
Share on other sites

On 04/02/2018 at 12:16 PM, jthornton said:

I downloaded the extension (rather easy in v6) but I'm having basic problems testing the store on my localhost so I had to delete it for now until I sort out why I can't view products in the storefront. Does the test time start over when I download again?

JT

If it's on a new domain / store, yes it does.

1 hour ago, jthornton said:

I'm trying to install this and the instructions say to

I don't see a product.php file and when I grep for some of the code I get this:


sudo grep -irl 'LANG.catalogue.add_to_basket' *
[sudo] password for john: 
modules/plugins/product_addons/CubeCart 6 foundation skin sample code.txt
modules/plugins/product_addons/skin/admin/index.tpl
skins/foundation/templates/element.product.call_to_action.php
skins/foundation/templates/content.category.php
skins/foundation/templates/content.homepage.php
skins/foundation/templates/content.certificates.php

Also your video very briefly mentions something about a store skin inversion 51custom hook is required. I have no clue what that means.

 

JT

 

in the newest versions of the Foundation theme, the content.product.php  file was split into some other files. you are most likely wanting the element.product.call_to_action.php file. You don't need to worry about the custom hook unless you are using an earlier version of CubeCart, if you have just installed it then I assume you are using the latest. :)

Edited by Noodleman
Link to comment
Share on other sites

When I enable and save the module I get this error.

Site error: the file /var/www/html/cubecart/modules/plugins/product_addons/hooks/controller.admin.php requires the ionCube PHP Loader ioncube_loader_lin_5.5.so to be installed by the website operator. If you are the website operator please use the ionCube Loader Wizard to assist with installation.

 

Link to comment
Share on other sites

From the error you are using PHP version 5.5, you also do not have the IonCube loaders installed on your web server. This is a requirement of the module.  Do you manage your own web server, or obtain your hosting from a company?

If your own server, see:
http://www.ioncube.com/loader_installer.php

If hosted via a company, they may have support articles which suggest how to enable it for you hosting package.

I would also recommend you change to at least PHP 5.6, or if available to you 7.1

 

Link to comment
Share on other sites

  • 1 month later...

I installed Debian 9 and got CubeCart 6.1.14 installed as well as The ionCube Loader version 10.2.0 for PHP 7.0  however I can not access my store or admin page anymore. All I get is a blank page for both. The following is the steps I used to install CubeCart.

install Debian 9 ssh and web server
sudo mkdir /var/www/html/cubecart
sudo chown -R www-data:www-data /var/www/html/cubecart
sudo usermod -a -G www-data $USER
sudo chmod g+w /var/www/html/cubecart
copy cubecart files to /var/www/html/cubecart
sudo chown -R www-data:www-data /var/www/html/cubecart

sudo apt-get update
sudo apt-get install php7.0
sudo apt-get install php-xml
sudo apt-get install php-mysql
sudo apt-get install php7.0-gd
sudo apt-get install php-curl
sudo apt-get install php7.0-zip
sudo apt-get install mariadb-server mariadb-client
sudo apt-get install phpmyadmin
yes yes

To enable it the apache2 rewrite module
sudo a2enmod rewrite

sudo nano /etc/php/7.0/apache2/php.ini
To enable MySQLi uncommented this line
extension=php_mysqli.dll
To enable cURL uncomment this line
extension=php_curl.dll

sudo nano /etc/apache2/apache2.conf

add

Include /etc/phpmyadmin/apache.conf

<Directory /var/www/html/cubecart>
        AllowOverride All
</Directory>

sudo mysql -u root
USE mysql;
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON * . * TO 'username'@'localhost';
FLUSH PRIVILEGES;
SELECT User, Host, plugin FROM mysql.user;
exit;

sudo systemctl restart apache2

localhost/phpmyadmin
user username

create a database for cubecart

Setup for running on localhost

In /includes/global.inc.php, add the following:

sudo nano /var/www/html/cubecart/includes/global.inc.php

$glob['storeURL'] = 'http://localhost/cubecart'; // No trailing slash
$glob['standard_url'] = 'http://localhost/cubecart'; // No trailing slash
$glob['ssl_url'] = 'http://localhost/cubecart'; // No trailing slash
$glob['cookie_domain'] = '127.0.1.1'; // No trailing slash
$glob['rootRel'] = '/cubecart/'; // YES trailing slash or just a slash
$glob['ssl_path'] = '/cubecart/'; // YES trailing slash or just a slash


Install cubecart in a browser
localhost/cubecart

 

also to install ioncube I did

sudo cp /var/www/html/ioncube/ioncube_loader_lin_7.0.so /usr/lib/php/20151012/ioncube_loader_lin_7.0.so

sudo cp /home/john/00-ioncube.ini /etc/php/7.0/apache2/conf.d/00-ioncube.ini

JT

Edited by jthornton
Link to comment
Share on other sites

PHP Fatal error:  The file /var/www/html/cubecart/modules/plugins/product_addons/hooks/controller.admin.php was encoded by the ionCube Encoder for PHP 5.0 and cannot run under PHP 7.0.\n Please ask the provider of the script to provide a version encoded with the ionCube Encoder for PHP 5.6. in Unknown on line 0, referer: http://localhost/cubecart/admin_ou6ju4.php?_g=plugins

JT

Link to comment
Share on other sites

I got this error after installing CubeCart again. I'm running HP Version 7.0.27-0. I don't see PHP 7.1 as being available for Debian 9.

PHP Fatal error:  <br/>The file <b>/var/www/html/cubecart/modules/plugins/product_addons/hooks/class.cart.construct.pre.php</b> was encoded with the Encoder for PHP 7.1 and can only run on PHP 7.1 or later.<br/> If you are the administrator of this site then please upgrade to PHP 7.1 or later and install the corresponding ionCube Loader. in Unknown on line 0, referer: http://localhost/cubecart/setup/index.php

 

Edited by jthornton
Link to comment
Share on other sites

You gotta love software developers that make incompatible changes... just curious why ioncube is needed for this module?

I copied the product_addons directory to /var/www/html/cubecart/modules/plugins and inserted the code in /var/www/html/cubecart/skins/foundation/templates/element.product.call_to_action.php and I see the Accessories and Essentials button in the test product but when create a new product I don't see the Product Addons tab. I went to Manage Extensions and Product Addons is checked as enabled.  What am I missing?

You might want to change the install instructions to point to the new file as the place to insert the code.

Also where can I change the text Accessories and Essentials to Options?

JT

Edited by jthornton
Link to comment
Share on other sites

I encode all of my commercial modules to protect my source code. It's common for commercial software to be protected.

I'm working on a revised copy/paste example in the upcoming update to the module. Something that is friendlier for responsive themes, and revised instructions.

Navigate to "Manage hooks" int he admin area, click on the addons module and save. then edit a product and check if the tab is there.

The text is in the copy/paste example.

 

 

Link to comment
Share on other sites

That makes sense I didn't think about code protection.

Ok when creating a new product the product addons tab does not show up, it does show up when editing a product.

The only place I can find accessories and essentials is the following line and sure enough when I change to options it changes. What tripped me up is it shows up in all caps and I was looking for ACCESSORIES AND ESSENTIALS

<div class="collapsible" id="section1">Accessories and Essentials<span></span></div>

JT

screenshot.png

Link to comment
Share on other sites

the warning about no changes made is a known thing. it's because the module stores it's data outside of the normal process which saved product data, thus CubeCart doesn't see the change and things there are no changes.

the module isn't conditional at the moment, meaning you can't dynamically drop the price for one item based on the addition of other items to the cart. It's not a feature of the module but may be something I will consider in the future. I've another module on my roadmap which may provide this feature, but it's quite a way off being developed.

There is a price override feature within the module, but it only checks if the addon product exits in the cart with it's parent product to apply the override price. it does not consider the other items which make up the kit.

 

 

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...