Jump to content

Dodgebill

Member
  • Posts

    164
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by Dodgebill

  1. Here is the code I am using for box.hnav.php

      {nocache}
       <div id="cssmenu">
     <ul> {$NAVIGATION_TREE}
                    {if $CTRL_CERTIFICATES && !$CATALOGUE_MODE}
                    <li><a href="{$URL.certificates}" title="{$LANG.navigation.giftcerts}"><span class="icon icon-gift"></span> {$LANG.navigation.giftcerts}</a></li>
                    {/if}
                    {if $CTRL_SALE}
                    <li><a href="{$URL.saleitems}" title="{$LANG.navigation.saleitems}"><span class="icon icon-tag"></span> {$LANG.navigation.saleitems}</a></li>
                    {/if}
            </ul> </div>
                   {/nocache}

     

  2. Those two worked just fine. Thanks for your help, again. I think I owe you a beer or something for all the help you've given me so far. Keep a tab running and we'll settle up somehow. BTW, is there anybody else on here? I remember back 10+ years ago there were hundreds of us on here....

    I can't believe there is no place in CC to put the company phone number.... That seems odd!

  3. I know I'm pushing my luck here with this one but it hopefully only hurts little to ask so here goes.

    I have a unique homepage from the rest of the store. This page has a custom horizontal css/jQuery navigation bar on it. The rest of the site is using a super-fish vertical nav menu. When caching is enabled as soon as you go from the homepage to any other page and back again the horizontal nav bar disappears. I am using ($NAVIGATION_TREE} for both of these in two different files.

    box.hnav.php

    box.navigation.php

    If I turn caching off it works fine. If I clear the cache I get one use, then it breaks again. Obviously it seems I have a conflict from using {$NAVIGATION_TREE} on the two different pages. Is there a way to fix this?

    Also, an jQuery experts here? The css menu I am using has an error for jQuery is undefined but I have no idea what that means or how it should be defined. I have a message out to the person who setup the menu but have not heard back yet. Thought I'd ask here too just in case....

  4. Next project I have been working on all day is trying to add the store name, address and phone number to the footer. This may require a hook but since I have no idea how those works I have no idea how to make that work.... I miss CC4, it was so easy! How do I add these things?

    I am also at a loss about the social icons. How the heck do I either get them to work or replace them with something MUCH better looking?

    I did get a whole new horizontal nav menu on the homepage of the lingerie skin. Still fine tuning all the colors on that and need a mobile version before it is finished. There have been numerous other changes today as well. It's about 80% done I'd say. When it is ready I'll ask that people test it and look for bugs. Then I'll put it in the Marketplace for all to download if they'd like.

    The fashion skin is just getting started. It's about 5% done at this point.

    http://www.cnkapparel.com/store/

    Let me know what you think

  5. It was working with the links until I made the homepage mod. I did just unlink the images just to see and no change. If I remove the mod it works again.

    Also, in the fashion skin (foundation based) the navigation subcategory drop downs on hover stopped working as well. It still works in my other skin but that is very differnt.

    It seems that there is some sort of error that is causing it to stop all scripts. I've never been able to figure out the debugging method for this for some reason.

  6. OK, so here is a funny new wrinkle. With the unique homepage mod in place when you go to the homepage the bxslider no longer works. Tried it in Foundation just to make sure and same thing. Completely baffled on that one. Any ideas where to start? Everything else works just fine.

    I have the test site up and running now. It's not a real store. DO NOT ORDER ANYTHING!

    http://www.cnkapparel.com/store

    This is lingerie based and maybe NSFW but it contains no nudity or adult content.

    You can select the different skins (at the bottom) and see the progress. I'm just starting the fashion skin today based on foundation. The other I have been building from scratch (mostly) for the past 2 months and is MUCH farther along.

  7. Genius! That works great.

    Here is the code I used

    In the main.php template file copy all the text between and including <body class="{$SECTION_NAME}"> and </body> and paste it AFTER </body>

    Change the first occurrence of

    <body class="{$SECTION_NAME}">

    to

    {if $SECTION_NAME=='home'}
    
    <body class="home">

     

     and then change the second occurrence of

    <body class="{$SECTION_NAME}">

    to

    {else}
    <body class="{$SECTION_NAME}">

    Then change the last

    </body>

    to

    </body> {/if}

    Then change anything you want in the top section of the code for the home page layout (between the {if} and {/if} commands) and the code on the second half is for all the rest of the pages.

  8. I've been working on my own custom skin for CC6 for a few weeks now and there is one thing I would really love to include. I want to have a different layout on the home page than on the category or product pages. In CC4 it was pretty easy to do that but I'm not seeing a way to do it in CC6.

    Instead of using main.php for everything but checkout I want to have a template page called home.php or something like that so I can change box locations and so forth just on the home page. I think this will really open up the design possibilities. Does anyone know how to make this work?

  9. OK, thanks for the info.

    Here is the code I have for the new pop products. I have been playing with it since I posted last and found if I took out all the 2's I added it still works the same. Simplfies things a bit I guess as well. This is the code in classes/cubecart.class.php

      {  $products = array();
    
                   /* $where = $GLOBALS['catalogue']->outOfStockWhere(array('status' => '1', 'featured' => '1')); */
    
                    if ($GLOBALS['config']->get('config', 'catalogue_latest_products')) {
                            $latestProducts = $GLOBALS['db']->select('CubeCart_inventory', false, (int)$GLOBALS['config']->get('config', 'catalogue_latest_products_count'));
                            if ($latestProducts) {
                                    foreach ($latestProducts as $product) {
                                            $category_data = $GLOBALS['catalogue']->getCategoryStatusByProductID($product['product_id']);
                                            $category_status = false;
                                            if (is_array($category_data)) {
                                                    foreach ($category_data as $trash => $data) {
                                                            if ($data['status'] == 1 && $data['cat_id'] == 16) {
                                                                    $category_status = true;
                                                            }
                                                    }
                                            }
                                            if (!$category_status) {
                                                    continue;
                                            }
                                            // Product Translation
                                            $GLOBALS['language']->translateProduct($product);
                                            $product['image'] = $GLOBALS['gui']->getProductImage($product['product_id'], 'small');
                                            $product['ctrl_sale'] = (!$GLOBALS['tax']->salePrice($product['price'], $product['sale_price']) || !$GLOBALS['config']->get('config', 'catalogue_sale_mode')) ? false : true;
    
                                            $GLOBALS['catalogue']->getProductPrice($product);
                                            $sale = $GLOBALS['tax']->salePrice($product['price'], $product['sale_price']);
                                            $product['price_unformatted'] = $product['price'];
                                            $product['sale_price_unformatted'] = ($sale) ? $product['sale_price'] : null;
                                            $product['price'] = $GLOBALS['tax']->priceFormat($product['price']);
                                            $product['sale_price'] = ($sale) ? $GLOBALS['tax']->priceFormat($product['sale_price']) : null;
    
                                            $product['ctrl_stock'] = (!$product['use_stock_level'] || $GLOBALS['config']->get('config', 'basket_out_of_stock_purchase') || ($product['use_stock_level'] && $GLOBALS['catalogue']->getProductStock($product['product_id'], null, true))) ? true : false;
                                            $product['url'] = $GLOBALS['seo']->buildURL('prod', $product['product_id'], '&');
    
                                            $GLOBALS['smarty']->assign('CTRL_REVIEW', (bool)$GLOBALS['config']->get('config', 'enable_reviews'));
                                            if (($product_review = $GLOBALS['db']->select('CubeCart_reviews', 'SUM(`rating`) AS Score, COUNT(`id`) as Count', array('approved' => 1, 'product_id' => $product['product_id']))) !== false) {
                                                    if ($product_review[0]['Score'] !== "") {
                                                            $product['review_score'] = round($product_review[0]['Score']/$product_review[0]['Count'], 1);
                                                    }
                                            }
                                            $products[] = $product;
                                    }
                                    $lp_rand_keys = array_rand($products, 4);
                                    // Make sure there are 3 or more 'featured' products
                                    foreach ($lp_rand_keys as $rand_key) $lp_rand_products[$rand_key] = $products[$rand_key];
                                    $products = $lp_rand_products;
                                    $GLOBALS['smarty']->assign('LATEST_PRODUCTS', $products);
    
                            }
                    }
                    }
                    /* end latest products */
                    
                    /* Start Popular Products*/
                    
                {    $products = array();
    
                  //  $where = $GLOBALS['catalogue']->outOfStockWhere(array('status' => '1', 'featured' => '1'));
    
                    if ($GLOBALS['config']->get('config', 'catalogue_latest_products')) {
                            $popProducts = $GLOBALS['db']->select('CubeCart_inventory', false, (int)$GLOBALS['config']->get('config', 'catalogue_latest_products_count'));
                            if ($popProducts) {
                                    foreach ($popProducts as $product) {
                                            $category_data = $GLOBALS['catalogue']->getCategoryStatusByProductID($product['product_id']);
                                            $category_status = false;
                                            if (is_array($category_data)) {
                                                    foreach ($category_data as $trash => $data) {
                                                            if ($data['status'] == 1  && $data['cat_id'] == 67) {
                                                                    $category_status = true;
                                                            }
                                                    }
                                            }
                                            if (!$category_status) {
                                                    continue;
                                            }
                                            // Product Translation
                                            $GLOBALS['language']->translateProduct($product);
                                            $product['image'] = $GLOBALS['gui']->getProductImage($product['product_id'], 'small');
                                            $product['ctrl_sale'] = (!$GLOBALS['tax']->salePrice($product['price'], $product['sale_price']) || !$GLOBALS['config']->get('config', 'catalogue_sale_mode')) ? false : true;
    
                                            $GLOBALS['catalogue']->getProductPrice($product);
                                            $sale = $GLOBALS['tax']->salePrice($product['price'], $product['sale_price']);
                                            $product['price_unformatted'] = $product['price'];
                                            $product['sale_price_unformatted'] = ($sale) ? $product['sale_price'] : null;
                                            $product['price'] = $GLOBALS['tax']->priceFormat($product['price']);
                                            $product['sale_price'] = ($sale2) ? $GLOBALS['tax']->priceFormat($product['sale_price']) : null;
    
                                            $product['ctrl_stock'] = (!$product['use_stock_level'] || $GLOBALS['config']->get('config', 'basket_out_of_stock_purchase') || ($product['use_stock_level'] && $GLOBALS['catalogue']->getProductStock($product['product_id'], null, true))) ? true : false;
                                            $product['url'] = $GLOBALS['seo']->buildURL('prod', $product['product_id'], '&');
    
                                            $GLOBALS['smarty']->assign('CTRL_REVIEW', (bool)$GLOBALS['config']->get('config', 'enable_reviews'));
                                            if (($product_review = $GLOBALS['db']->select('CubeCart_reviews', 'SUM(`rating`) AS Score, COUNT(`id`) as Count', array('approved' => 1, 'product_id' => $product['product_id']))) !== false) {
                                                    if ($product_review[0]['Score'] !== "") {
                                                            $product['review_score'] = round($product_review[0]['Score']/$product_review[0]['Count'], 1);
                                                    }
                                            }
                                            $products[] = $product;
                                    }
                                    $pp_rand_keys = array_rand($products, 4);
                                    // Make sure there are 3 or more 'featured' products
                                    foreach ($pp_rand_keys as $rand_key) $pp_rand_products[$rand_key] = $products[$rand_key];
                                    $products = $pp_rand_products;
                                    $GLOBALS['smarty']->assign('POP_PRODUCTS', $products);
                                    }
                            }
                    }
    
                    foreach ($GLOBALS['hooks']->load('class.cubecart.display_homepage') as $hook) include $hook;
                    $content = $GLOBALS['smarty']->fetch('templates/content.homepage.php');
                    $GLOBALS['smarty']->assign('PAGE_CONTENT', $content);
            }

    and here is what was added to the home page template ( it's the e-scaler skin )

     <h2>Most Popular</h2>
    
            <div class="product-list">
    
                    {foreach from=$POP_PRODUCTS item=product}
                    <div class="product">
                            <form action="{$VAL_SELF}" method="post" class="addForm" id="P{$product.product_id}">
                                    <p class="image">
                                            <a href="{$product.url}" title="{$product.name}">
                                                    <img src="{$product.image}" alt="{$product.name}" />
                                            </a>
                                            {if $product.review_score && $CTRL_REVIEW}
                                            <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="old_price_cat">{$product.price}</span> <span class="sale_price_cat">{$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>
                                                    <input type="hidden" name="add" value="{$product.product_id}" />
                                                    {if $product.ctrl_stock && !$CATALOGUE_MODE}
                                                    <button type="submit" class="button_add_basket" onclick="$.add2cart('P{$product.product_id}')">{$LANG.catalogue.buy_now}</button>
                                                    {elseif !$CATALOGUE_MODE}
                                                    <button type="submit" class="button_add_basket disabled" disabled="disabled">{$LANG.catalogue.out_of_stock_short}</button>
                                                    {/if}
                                            </p>
                                    </div>
                            </form>
                    </div>
                    {/foreach}
            </div>
    </div>

     

  10. OK, follow up question. I wanted to add a couple of more boxes on the home page with the most popular items in a category (other than the one already used above)

    I copied this code, placed in between

    $GLOBALS['smarty']->assign('LATEST_PRODUCTS', $products);

    and

    foreach ($GLOBALS['hooks']->load('class.cubecart.display_homepage') as $hook) include $hook;

    I called it $popProducts with a hook of {POP_PRODUCTS} and added that to the homepage template. That worked, sort of... BUT all I get is photos from the correct category with no prices and it says "info" and out of stock. The links are correct. I relabeled everything that was a variable with a 2 at the end ($Products2, $category_status2, etc) hoping that was differentiate it from the latest product section but that just made it so I did not get duplicate products from the section above.

    Where am I going wrong?

  11. Thank you so much. I just learned a whole lot with that info so thanks for that. I was able to make that work but I had to remove the 'where' statement from line 96.

    My next question, is this too big a load on the server? Is it randomizing the whole inventory table or just the products in cat 16? I have 1,300 products and my host (hostgator) is a real pain about server load. I know rand() is sort of frowned upon so how would I use shuffle as you mentioned?

    Bill

     

  12. As the title states I'm trying to switch the latest products on the home page to show a group of random products from just one category.  This isn't really a skin question I guess but...

    I see the piece of code on line 96 in classes/cubecart.class.php

    $latestProducts = $GLOBALS['db']->select('CubeCart_inventory', false, $where, array('date_added' => 'DESC', 'product_id' => 'DESC'), (int)$GLOBALS['config']->get('config', 'catalogue_latest_products_count'));

    And if I jump to classes/catalogue.class.php line 617 I see this code

    if (($result = $GLOBALS['db']->query('SELECT I.product_id FROM `'.$GLOBALS['config']->get('config', 'dbprefix').'CubeCart_category_index` as I,  `'.$GLOBALS['config']->get('config', 'dbprefix').'CubeCart_inventory` as INV WHERE I.cat_id = '.$category_id.' AND I.product_id = INV.product_id AND INV.status = 1'.$where2)) !== false) {

    That would pull up all the products for a specified category. How would I go about making this work? I have tried and tried but with no luck. Say I wanted to use $category_id = 16

    Bill

  13. I copied the font awesome folder and looked everywhere for the code or css that make it work but with no luck. There has to be more to it I guess. I can't get it to show the icons. Any idea where the code is that controls them? There is nothing in the DB that can be used for this. I'm at a loss other than just ditch it and create my own links manually but that loses the cool factor.....

    Bill

×
×
  • Create New...