Jump to content

SentiJB

Member
  • Posts

    46
  • Joined

  • Last visited

Everything posted by SentiJB

  1. I have a lot of different product on my shops , i want to set this up : If a customer wants to buy a product from one specific category they have to pay 1 time an extra charge of 12€ : - with product options i can't set this up , if they order 10x there is a charge for 120 € - if i use the category mod : i can setup in plugin they are charged 12 € BUT if they order an other product from other category it still shows in checkout as an option . If i try to do the handling in category itself it doesn't work. only when i set it up in plugin itself. I dont want it to be shown as a checkout option if they don't order a product from that specific category. Is there a mod ( not encrypted => doesnt work with my host ) for this ? Or how can i set this up ?
  2. this one i made is free and just very basic... since you all work with encoded data i needed to write it myself.
  3. So i don't know how you write a module. But this is the coding for a wishlist mod i want to share. I use latest version of cubecart First Backup all files ! It works with me , maybe coding needs some cleanup. First alter database , DONT FORGET TO ADD THE PREFIX IF YOU USE ONE : CREATE TABLE `CubeCart_WISHLIST` ( `id` int(10) UNSIGNED NOT NULL, `product_id` int(10) UNSIGNED NOT NULL, `customer_id` int(10) UNSIGNED NOT NULL, `time` int(10) UNSIGNED NOT NULL, `WISHLIST_remark` text COLLATE utf8_unicode_ci NOT NULL, `email` varchar(254) COLLATE utf8_unicode_ci NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `filepath` varchar(255) COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ALTER TABLE `CubeCart_WISHLIST` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT voor geëxporteerde tabellen -- -- -- AUTO_INCREMENT voor een tabel `_cubecartCubeCart_WISHLIST` -- ALTER TABLE `CubeCart_WISHLIST` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1; in CubeCart_inventory you need to add allow_wishlist tinyint(1) UNSIGNED also FIRST STEP : Open classes/cubecart.class.php FIND : $product['description_short'] = $GLOBALS['catalogue']->descriptionShort($product); BELOW ADD : $product['allow_wishlist'] = $product['allow_wishlist']; FIND : case 'template': if (isset($_GET['type']) && isset($_GET['module'])) { $module = preg_replace('#[^a-z0-9\_\-]#iU', '', $_GET['module']); $type = preg_replace('#[^a-z0-9\_\-]#iU', '', $_GET['type']); $template = 'modules/'.$type.'/'.$module.'/skin/inline.php'; if (file_exists($template)) { $GLOBALS['smarty']->assign('PAGE_CONTENT', file_get_contents($template, false)); } } break; BELOW ADD : case 'WISHLISTITEMS': $GLOBALS['smarty']->assign('SECTION_NAME', 'wishlistitem'); $this->_wishlistitems(); break; FIND : /** * 404 Handling */ private function _404() { foreach ($GLOBALS['hooks']->load('class.cubecart.404') as $hook) include $hook; header("HTTP/1.0 404 Not Found"); $template = 'templates/content.404.php'; if ($content = $GLOBALS['smarty']->templateExists($template)) { $content = $GLOBALS['smarty']->fetch($template); } else { $content = '<h2>'.$GLOBALS['language']->documents['404_title']."</h2>\r\n<p>".$GLOBALS['language']->documents['404_content'].'</p>'; } $GLOBALS['smarty']->assign('PAGE_CONTENT', $content); } BELOW ADD : /** * wishlistmod */ private function _WISHLISTITEMS() { foreach ($GLOBALS['hooks']->load('class.cubecart.construct.wishlist') as $hook) { include $hook; } if ($GLOBALS['user']->is()) { if (isset($_POST['wishlistitem_delete']) && is_array($_POST['wishlistitem_delete'])) { foreach ($_POST['wishlistitem_delete'] as $id) { $GLOBALS['db']->delete('CubeCart_WISHLIST', array('id' => (int)$id)); $GLOBALS['gui']->setNotify('Item is verwijderd'); httpredir(currentPage()); }} $page = (isset($_GET['p'])) ? $_GET['p'] : 1; $per_page = 15; $where = array('customer_id' => $GLOBALS['user']->get('customer_id')); if (($wishlistitems = $GLOBALS['db']->select('CubeCart_WISHLIST', false, $where, array('id' => 'DESC'), $per_page, $page, false)) !== false) { $GLOBALS['smarty']->assign('PAGINATION', $GLOBALS['db']->pagination($GLOBALS['db']->getFoundRows(), $per_page, $page, 5, $var_name = 'p')); foreach ($wishlistitems as $wishlistitem) { $wishlistitem['datum'] = formatTime($wishlistitem['time']) ; $wishlistitem['product_id'] = $wishlistitem['product_id']; $wishlistitem['title'] = $wishlistitem['title']; $wishlistitem['WISHLIST_remark'] = $wishlistitem['WISHLIST_remark']; $wishlistitem['product_url'] = $GLOBALS['seo']->buildURL('prod', $wishlistitem['product_id']); $vars['wishlistitems'][] = $wishlistitem; } } else { $vars['wishlistitems'] = false; } $GLOBALS['smarty']->assign('wishlistitemS', $vars['wishlistitems']); $GLOBALS['gui']->addBreadcrumb($GLOBALS['language']->account['your_account'], 'index.php?_a=account'); $GLOBALS['gui']->addBreadcrumb($GLOBALS['language']->wishlist['your_userwishlist'], currentPage()); $content = $GLOBALS['smarty']->fetch('templates/content.wishlist_user.php'); $GLOBALS['smarty']->assign('PAGE_CONTENT', $content); } else { httpredir('?_a=login'); } } FIND : /** * Products */ private function _product() { if (($product = $GLOBALS['catalogue']->getProductData($_GET['product_id'])) === false) { return; } BELOW ADD : if (isset($_POST['WISHLIST']) && is_array($_POST['WISHLIST'])) { $error = false; foreach ($GLOBALS['hooks']->load('class.cubecart.wishlist') as $hook) { include $hook; } $record = array_map('htmlspecialchars', $_POST['WISHLIST']); if ($GLOBALS['user']->is()) { $record['customer_id'] = $GLOBALS['user']->get('customer_id'); $record['email'] = $GLOBALS['user']->get('email'); } else { $record['customer_id'] = 0; if (!$GLOBALS['session']->isEmpty('error', 'recaptcha')) { $GLOBALS['gui']->setError($GLOBALS['session']->get('error', 'recaptcha')); $error = true; } } $record['product_id'] = (int)$_GET['product_id']; $record['time'] = time(); $record['title'] = (isset($_POST['title'])) ? $_POST['title'] : ''; $record['filepath'] = (isset($_POST['filepath'])) ? $_POST['filepath'] : ''; if (($WISHLIST_id = $GLOBALS['db']->insert('CubeCart_WISHLIST', $record)) !== false) { foreach ($GLOBALS['hooks']->load('class.cubecart.wishlist.insert') as $hook) { include $hook; } $GLOBALS['gui']->setNotify($GLOBALS['language']->catalogue['notify_wenslijst_submit']); } else { $GLOBALS['gui']->setError($GLOBALS['language']->catalogue['error_review_submit']); } httpredir(currentPage(null)); } else { foreach ($_POST['WISHLIST'] as $key => $value) { $_POST['WISHLIST'][$key] = htmlspecialchars($value); } $GLOBALS['smarty']->assign('WRITE', $_POST['WISHLIST']); } SECOND STEP : Open skins/YOURSKIN/templates/content.product.php FIND : <div id="quantity_discounts"> <h4>{$LANG.catalogue.quantity_discounts}</h4> <p>{$LANG.catalogue.quantity_discounts_explained}</p> <table class="list discounts_table"> <thead> <tr> <th>{$LANG.common.quantity}</th> <th>{$LANG.catalogue.price_per_unit}</th> </tr> </thead> <tbody> {foreach from=$PRODUCT.discounts item=discount} <tr> <td align="center">{$discount.quantity}+</td> <td align="center">{$discount.price}</td> </tr> {/foreach} </tbody> </table> </div> {/if} BELOW ADD : {if ($PRODUCT.allow_wishlist) == '1' } <div id="WISHLIST"> <div id="WISHLIST_read"> <p><a href="#" onclick="$('#WISHLIST_read').slideToggle(); $('#WISHLIST_write').slideToggle(); return false;">Add To Your Wishlist</a></p> </div> <div id="WISHLIST_write" style="display: none;"> <form action="{$VAL_SELF}#WISHLIST_write" method="post"> {if $IS_USER} <p> You're about to add : {$PRODUCT.name} in wishlist. </p> <p> <label for="rev_title">Product name:</label> <input id="rev_title" type="hidden" name="title" value="{$PRODUCT.name}" class="textbox" /> {$PRODUCT.name} </p> <p> <label for="rev_WISHLIST">Your Remark:</label> <textarea id="rev_WISHLIST_remark" name="WISHLIST[WISHLIST_remark]" rows="10" cols="40">{$WRITE.WISHLIST_remark}</textarea> </p> <p> <input type="submit" value="Confirm" class="button_submit" /> <input type="button" onclick="$('#WISHLIST_read').slideToggle(); $('#WISHLIST_write').slideToggle();" value="{$LANG.common.cancel}" class="button_submit" /> </p> {else} <p>You need to <a href="login"> login </a> first to add this product : {$PRODUCT.name} to your wishlist </p> {/if} {include file='templates/content.recaptcha.php'} </form> </div> </div> {/if} Open your language file : FIND : </group> BELOW ADD : <group name="wishlist"> <string name="your_userwishlist" introduced="5.0.0"><![CDATA[Items in your wishlist]]></string> <string name="notify_wishlist_submit" introduced="5.0.0"><![CDATA[Added to your wishlist]]></string> <string name="notify_submit" introduced="5.0.0"><![CDATA[Added]]></string> </group> FIND : <string name="notify_review_submit" introduced="5.0.0"> AFTER : </string> ADD BELOW : <string name="notify_wenslijst_submit" introduced="5.0.0"><![CDATA[Added to your wishlist]]></string> STEP 3 : Open skins/YOURSKIN/templates/content.account.php FIND : <li><a href="{$STORE_URL}/index.php?_a=profile" title="{$LANG.account.your_details}">{$LANG.account.your_details}</a></li> ADD : <li><a href="{$STORE_URL}/index.php?_a=WISHLISTITEMS" title="Your Wishlist">Your Wishlist</a>{$LANG.account.your_details}</a></li> STEP 4 : create a new file with the code below , name it content.wishlist_user.php opload it in templates {if $IS_USER} <h1><p><img alt="" src="/images/source/WishList-logo.gif" style="width: 284px; height: 150px;" /></p></h1> <div class="paginate">{if isset($PAGINATION)}{$PAGINATION}</div> <div class="list"> <form action="{$VAL_SELF}" method="post" enctype="multipart/form-data"> <table width="100%"> <td nowrap="nowrap"><b>Product</b></td> <td><b>Added on :</b></td> <td><b>Your remark</b></td> <td>&nbsp;</td> {foreach from=$wishlistitemS item=wishlistitem} <tr> <td align="center"><a href="{$wishlistitem.product_url}" title="View Item"> {$wishlistitem.title} </a></td> <td> {$wishlistitem.datum} </td> <td> {$wishlistitem.WISHLIST_remark} </td> <td><input type="hidden" name="wishlistitem_delete[]" value="{$wishlistitem.id}" /></span> <p> <input type="submit" value="VERWIJDER" /> </p> </td> {/foreach} {/if} </table > </form> {$PAGINATION} </div> {if !isset($PAGINATION)} <p>No items in your wishlist</p> {/if} {/if} NOW WE GONNA DO THE ADMIN AREA : open : admin folder / sources/products.index.inc.php FIND : 'digital' => $GLOBALS['db']->column_sort('digital', $lang['common']['type'], 'sort', $current_page, $_GET['sort']), ADD AFTER : 'allow_wishlist' => $GLOBALS['db']->column_sort('allow_wishlist', $lang['common']['allow_wishlist'], 'sort', $current_page, $_GET['sort']), open : admin folder / skins/default/templates/products.index.inc.php FIND : <div><label for="condition">{$LANG.catalogue.condition}</label> <span> <select name="condition" id="condition" class="textbox" type="text"> <option value="new" {if $PRODUCT.condition == 'new'}selected="selected"{/if}>{$LANG.catalogue.condition_new}</option> <option value="used" {if $PRODUCT.condition == 'used'}selected="selected"{/if}>{$LANG.catalogue.condition_used}</option> <option value="refurbished" {if $PRODUCT.condition == 'refurbished'}selected="selected"{/if}>{$LANG.catalogue.condition_refurbished}</option> </select> </span> </div> ADD AFTER : <div><label for="allow_wishlist">Can a user add this product to their wishlist</label> <span> <select name="allow_wishlist" id="allow_wishlist" class="textbox" type="text"> <option value="1" {if $PRODUCT.allow_wishlist == '1'}selected="selected"{/if}>YES</option> <option value="0" {if $PRODUCT.allow_wishlist == '0'}selected="selected"{/if}>No</option> </select> </span> </div
  4. Using : e-Sharp Skin Php code for categories : <h1>{$category.cat_name}</h1> {$category.cat_desc} {if $SUBCATS} <div id="subcategories"> {foreach from=$SUBCATS item=subcat} <div class="subcategory"> <a href="{$subcat.url}" title="{$subcat.cat_name}"> <img src="{$subcat.cat_image}" alt="{$subcat.cat_name}" /> {$subcat.cat_name} </a> </div> {/foreach} </div> {/if} {if isset($PRODUCTS) && count($PRODUCTS) >= 1} <form action="{$VAL_SELF}" method="post" class="control"> <span class="pagination">{if isset($PAGINATION)}{$PAGINATION}{/if}</span> {if isset($SORTING)} <span class="sort"> {$LANG.form.sort_by} <select name="sort" class="auto_submit"> <option value="">{$LANG.form.please_select}</option> {foreach from=$SORTING item=sort} <option value="{$sort.field}|{$sort.order}" {$sort.selected}>{$sort.name} ({$sort.direction})</option> {/foreach} </select> <input type="submit" value="{$LANG.form.sort}" /> </span> {/if} </form> {/if} {if isset($PRODUCTS)} <div class="product-list"> {foreach from=$PRODUCTS item=product} <form action="{$VAL_SELF}" method="post" enctype="application/x-www-form-urlencoded" class="product addForm" id="P{$product.product_id}"> <p class="image"> <a href="{$product.url}" title="{$product.name}"> <img src="{$product.thumbnail}" alt="{$product.name}" /> </a> {if $product.review_score} <span class="rating"> {for $i = 1; $i <= 5; $i++} {if $product.review_score >= $i} <span class="icon icon-star3"></span> {elseif $product.review_score > ($i - 1) && $product.review_score < $i} <span class="icon icon-star2"></span> {else} <span class="icon icon-star"></span> {/if} {/for} </span> {/if} </p> <div class="info"> <p class="title"><a href="{$product.url}" title="{$product.name}">{$product.name|truncate:40:"&hellip;"}</a></p> {if $product.ctrl_sale} <p class="price"><span class="price_previous">{$product.price}</span> <span class="price_sale">{$product.sale_price}</span></p> {else} <p class="price">{$product.price}</p> {/if} <p class="actions"> <a href="{$product.url}" title="{$product.name}">{$LANG.common.info}</a> {if $product.ctrl_purchase && !$CATALOGUE_MODE} <input type="hidden" name="add[{$product.product_id}][quantity]" value="1" class="quantity" /> <input type="submit" value="{$LANG.catalogue.buy}" class="btn button_add_basket" onclick="$.add2cart('P{$product.product_id}')" /> {elseif $product.out} <input type="button" value="{$LANG.catalogue.out_of_stock_short}" class="btn disabled" disabled="disabled" /> {/if} </p> </div> </form> {/foreach} </div> {else} {if !$SUBCATS}<p>{$LANG.category.no_products}</p>{/if} {/if} {if isset($PRODUCTS) && count($PRODUCTS) >= 1} <form action="{$VAL_SELF}" method="post" class="control"> <span class="pagination">{if isset($PAGINATION)}{$PAGINATION}{/if}</span> {if isset($SORTING)} <span class="sort"> {$LANG.form.sort_by} <select name="sort" class="auto_submit"> <option value="">{$LANG.form.please_select}</option> {foreach from=$SORTING item=sort} <option value="{$sort.field}|{$sort.order}" {$sort.selected}>{$sort.name} ({$sort.direction})</option> {/foreach} </select> <input type="submit" value="{$LANG.form.sort}" /> </span> {/if} </form> {/if} How can i fix the layout so its nice : eg : http://www.allesvooruwhuisdier.com/garnalen
  5. found the error. had something to do with php version of new site. changed it to 7.4 (in stead of 8 ) and it works now
  6. send you pm with admin url.
  7. I started New site. Same host as other site. Did New install. When i go to admin area. Dont get the login possibility. I tried 3 versions of cubecart. On all 3 same problem. Only thing i see is the cubecart logo. Below there is a very small White stripe where normaly you can enter the data. Any one that knows what could be wrong
  8. Thanks. Will give it a try
  9. Is there a mod or a way to send an email to specific customer somewhere in admin ?
  10. Anyone knows if its possible to add the extra fees for payment with stripe to cart total?
×
×
  • Create New...