Hide Bundle Items in Magento - magento

I'm looking for help with a rather frustrating Magento issue I can't seem to get my head around.
On our Magento site we have several Bundled Products. These work fine etc but all the items of the Bundled Product are displayed on the page; it makes the page unnecessarily long & the list isn't need as the items are fixed, customers can not change or edit any of the items.
Ideally what I would like to do is stop those items being displayed so it looks more like a normal product page.
I have tried editing the view.phtml file located in:
app/design/frontend/default/my_theme/template/catalog/product/
I found the following blocks of code:
<?php if ($_product->isSaleable() && $this->hasOptions()):?>
<?php echo $this->getChildChildHtml('container1', '', true, true) ?>
<?php endif;?>
<?php if ($_product->isSaleable() && $this->hasOptions()):?>
<?php echo $this->getChildChildHtml('container2', '', true, true) ?>
<?php endif;?>
When the 'container2' lines are removed, it does remove the list of bundled items but also removes the 'Add to cart' button too.
Would appreciate any help on this as I haven't been able to resolve this issue using Google Sensei.

Step:1 First Remove below Lines from --template\catalog\product\view.phtml
if ($_product->isSaleable() && $this->hasOptions()):?>
<?php echo $this->getChildChildHtml('container2', '', true, true) ?>
<?php endif; ?>
Step2: Add Below Lines inplace of Above lines
<?php echo $this->getLayout()->createBlock('core/template')->setTemplate('catalog/product/view/addtocart.phtml')->toHtml(); ?>
Step3: --template\catalog\product\view\addtocart.phtml
Remove All Lines from file and add below code
<?php $_product = $this->getProduct(); ?>
<?php $buttonTitle = $this->__('Add to Cart'); ?>
<div class="add-to-cart">
<?php ?>
<label for="qty"><?php echo $this->__('Qty:') ?></label>
<input type="text" name="qty" id="qty" maxlength="12" value="<?php echo $this->getProductDefaultQty() * 1 ?>" title="<?php echo $this->__('Qty') ?>" class="input-text qty" />
<!--<button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>-->
<button type="button" title="<?php echo $buttonTitle ?>" class="button btn-cart" onclick="productAddToCartForm.submit(this)"><span><span><?php echo $buttonTitle ?></span></span></button></p>
<?php echo $this->getChildHtml('', true, true) ?>
</div>
Step4: - Go to admin panel, Go to products and if custom Options are marked as required mark them as not required.
See this screen shot for more info
Thanks...

Although this is a very old issue, but thought this might be useful for someone who runs into the requirement.
All you would want to do is, edit the .phtml file which renders the Bundle items.
This is how I solved it:
Usually the file you would want to edit would be:
YOUR_THEME->default->template->bundle->catalog->product->view->type->bundle->option->select.phtml
If you cant find this path in your theme, then:
Step1) Turn on Template hint from System->Configuration. Click on Developer, and under Debug tab, Enable the Template hint.
Step 2) Refresh or go to the product view page, where your bundle items are listed, locate the file through template hint.
Once you are in select.phtml file, you can do whatever you want to hide or display or change the code. I just added a div with "display:none" style, and it hid the whole "Bundle Item" block.

Related

Magento Save Value in Custom Attribute of Customer from one page checkout (billing.phtml)

I have made one attribute for customer registration. It is working fine on registration. I am getting problem on one page checkout. Like normal registration, i am also taking value from customer during one step checkout registration but problem is that it doesn't store the value in attribute. thank you in advance
code of billing.phtml which display textbox for attribute to take value from user
<li class="fields">
<div class="field">
<label for="<?php echo $attribute->getAttributeCode(); ?>" <?php if($attribute->getIsRequired()):?>class="required"><em>*</em> <?php else :?>><?php endif;?><?php echo $this->__($frontEndLabel) ?></label>
<div class="input-box">
<?php if($attribute->getFrontendInput()== 'text'):?>
<input type="text" name="billing[test]" id="billing:<?php echo $attribute->getAttributeCode(); ?>" title="<?php echo $this->__($frontEndLabel); ?>" class="input-text <?php echo $fieldRequiredClass; ?> <?php echo $fieldFrontendClass ;?>" />
<?php endif ?>
</div>
</div>
<?php endif ?>
<?php endforeach ?>
</li>
Just Update following code in your config.xml and check it
<fieldsets>
<checkout_onepage_quote>
<attributename>
<to_customer>*</to_customer>
</attributename>
</checkout_onepage_quote>
</fieldsets>

Magento - Change quantity label text to hours and have a dropdown

Need help on how to change the label "quantity" to "hours" and have a drop down. I have tier pricing on that particular product. I need to replace the text "quantity" to hours on that particular product alone. Help required. Thanks in advance.
To change label navigate to Backend > catalog > attribute > manage attribute Search for your targeted attribute. And edit on the left side on attribute information section > Manage Label/options and there you will find titles section and change the label.
Regarding changing attribute type to dropdown from Catalog Input Type for Store Owner once you assign and save an attribute you cannot change there after.
Edit
To change for only one product check for it and if is true print other label.
$_product->getAttributeText('quantity')
You can do it programatically in this way:
Add a custom phtml file for addtocart part under: app/design/frontend/[your_template_package_name]/[your_template_name]/template/catalog/product/view/addtocart_custom.phtml
with this content:
<?php $_product = $this->getProduct(); ?>
<?php $buttonTitle = $this->__('Add to Cart'); ?>
<?php if($_product->isSaleable()): ?>
<div class="add-to-cart">
<?php if(!$_product->isGrouped()): ?>
<label for="qty"><?php echo $this->__('Hours:') ?></label>
<select class="input-text qty" name="qty" id="qty">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<?php endif; ?>
<button type="button" title="<?php echo $buttonTitle ?>" class="button btn-cart" onclick="productAddToCartForm.submit(this)"><span><span><?php echo $buttonTitle ?></span></span></button>
<?php echo $this->getChildHtml('', true, true) ?>
</div>
<?php endif; ?>
Add on your product page in Magento admin the following layout update under Product details->Design->Custom layout update:
<reference name="product.info.addtocart">
<action method="setTemplate"><template>catalog/product/view/addtocart_custom.phtml</template></action>
</reference>
in my case (magento ce 1.9.2) the path to addtocart.phtml is:
app/design/frontend/YOURTEMPLATE/default/template/catalog/product/view
replace the word "Quantity" with your word(s) in a line (in my case - line# 32) that starts with:
<label for="qty">
gl,
H

joomla based owl Carousel

We have a Joomla based school website, we have a owl carousel at the bottom that scrolls along.
I would like to make the images contained links to their to websites.
I've looked everywhere to find where the code for the owl carousel is but i cant find it. There is a module for it but it hasn't anywhere to alter the code.
The site URL is: http://www.kibworthprimary.org.uk
This is the code in the tmpl folder inside default.php
<div class="owlcarousel<?php echo $moduleclass_sfx ?> <?php echo $alias ?>" <?php if ($params->get('backgroundimage')) : ?> style="background-image:url(<?php echo $params->get('backgroundimage');?>)"<?php endif;?>>
<?php echo $module->content;?>
<div id="owl-carousel-<?php echo $module->id; ?>" class="owl-carousel owl-theme">
<?php foreach($gallery as $count=>$photo):
$title = JString::ucwords(str_replace("-", " ", strstr($photo->filename, '.', 1))); ?>
<div class="item">
<img class="lazyOwl img-responsive" src="<?php echo $photo->thumbImageFilePath; ?>" data-src="<?php echo $photo->thumbImageFilePath; ?>" alt="<?php echo $title; ?>" title="<?php echo $title; ?>" />
</div>
<?php endforeach; ?>
</div>
In the end i looked at the HTML the module was producing and used that as a base. It was set to look at a directory of images and display them there but these images will not be changing and so that function wasn't needed.
All is now working by simple wrapping a href tag around the item lists.

Magento: Add image between top navigation (or header) and search form

how can I add an image with js code and external link in my top navigation. It should be placed between the menu links and search form.
maybe it has to be adapted in the header. I don`t know it also how to do it there.
here u can see a screenshot of the current site.
Screenshot
<?php if ($customlogo['logo_status'] == 0): ?>
<h1 class="logo"><strong><?php echo $this->getLogoAlt() ?></strong><img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" /></h1>
<?php else:?>
<h1 class="logo"><strong><?php echo $customlogo['logo_alt']; ?></strong><img src="<?php echo $mediaurl.$customlogo['logo']; ?>" alt="<?php echo $customlogo['logo_alt']; ?>" /></h1>
<?php endif; ?>
<div class="quick-access">
<div class="menu-button"></div>
<?php echo $this->getChildHtml('topMenu') ?>
GUESS, it must placed between these two code snippets... but how?
<?php echo $this->getChildHtml('topSearch') ?>
<div class="clear"></div>
</div>
thx in advance
You answered your own question really. Replace GUESS, it must be placed... with image tag and use css to style accordingly. Alternatively, you can create a custom block and phtml file, add an instance of your block to page.xml layout file and then in the template as above you could use $this->getChildHtml('myCustomBlock'), but for the sake of a single image I would use the first image or use CSS background styles if that's what's it for. You could also insert the image in the phtml file for topMenu or topSearch. I suggest you read the design guide http://www.magentocommerce.com/knowledge-base/categories/category/themes-and-design/

Magento continue shopping url change

Is there any setting in magento backend to change continue shopping url ? If there any settings is there let me know How I can change. I am using Magento 1.7.x
Sadly not, I've always wondered why this hasn't been in the configuration. You have two choices, you can either extend Mage_Checkout_Block_Cart to apply logic to determine what URL to use or you can set the the URL in the template.
<?php $this->setContinueShoppingUrl('http://URL.com'); ?>
<div class="page-title">
<h1><?php echo $this->__('Shopping Cart is Empty') ?></h1>
</div>
<div class="cart-empty">
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
<p><?php echo $this->__('You have no items in your shopping cart.') ?></p>
<p><?php echo $this->__('Click here to continue shopping.', $this->getContinueShoppingUrl()) ?></p>
</div>
However, if you're going to set it in the template, you might as well just remove change <?php echo $this->__('Click here to continue shopping.', $this->getContinueShoppingUrl()) ?> to <?php echo $this->__('Click here to continue shopping.') ?>
To change redirect url of continue shopping button in "NOT" empty shopping cart just add the second code line following highlighted with asterix ** in ...your_theme/default/checkout/cart.phtml:
<?php if($this->getContinueShoppingUrl()): ?>
**<?php $this->setContinueShoppingUrl('http://yoursite.com/...'); ?>**
<button type="button" title="<?php echo $this->__('Continue Shopping') ?>" class="button btn-continue" onclick="setLocation('<?php echo $this->getContinueShoppingUrl() ?>')"><span><span><?php echo $this->__('Continue Shopping') ?></span></span></button>
<?php endif; ?>
cheap & effective
Thanks to previous answer/hint

Resources