I have tried to create new payment method in Magento 2. When I tried to configure it, it is coming in the back end, but not in the front end. If anyone has fixed this issue, please let me know the fixes.
My block form for Quickpay.php
<?php
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Quickpay\Block\Form;
/**
* Block for Quickpay payment method form
*/
class Quickpay extends \Magento\Quickpay\Block\Form\AbstractInstruction
{
/**
* Cash on delivery template
*
* #var string
*/
protected $_template = 'form/quickpay.phtml';
}
AbstractInstuction.php
<?php
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Quickpay\Block\Form;
/**
* Abstract class for Quickpay payment method form
*/
abstract class AbstractInstruction extends \Magento\Payment\Block\Form
{
/**
* Instructions text
*
* #var string
*/
protected $_instructions;
/**
* Get instructions text from config
*
* #return null|string
*/
public function getInstructions()
{
if ($this->_instructions === null) {
/** #var \Magento\Payment\Model\Method\AbstractMethod $method */
$method = $this->getMethod();
$this->_instructions = $method->getConfigData('instructions');
}
return $this->_instructions;
}
}
Model Quickpay.php
<?php
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Quickpay\Model;
/**
* Quickpay payment method model
*
* #method \Magento\Quote\Api\Data\PaymentMethodExtensionInterface getExtensionAttributes()
*/
class Quickpay extends \Magento\Payment\Model\Method\AbstractMethod
{
const PAYMENT_METHOD_QUICKPAY_CODE = 'quickpay';
/**
* Payment method code
*
* #var string
*/
protected $_code = self::PAYMENT_METHOD_QUICKPAY_CODE;
/**
* Cash On Delivery payment block paths
*
* #var string
*/
protected $_formBlockType = 'Magento\Quickpay\Block\Form\Quickpay';
/**
* Info instructions block path
*
* #var string
*/
protected $_infoBlockType = 'Magento\Payment\Block\Info\Instructions';
/**
* Availability option
*
* #var bool
*/
protected $_isOffline = true;
/**
* Get instructions text from config
*
* #return string
*/
public function getInstructions()
{
return trim($this->getConfigData('instructions'));
}
}
view adminhtml/templates/form/quickpay.html
<?php
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
// #codingStandardsIgnoreFile
/**
* #var $block \Magento\Quickpay\Block\Form\Quickpay
*/
$instructions = $block->getInstructions();
?>
<?php if ($instructions): ?>
<?php $methodCode = $block->escapeHtml($block->getMethodCode());?>
<ul class="form-list checkout-agreements" id="payment_form_<?php /* #noEscape */ echo $methodCode ?>" style="display:none;">
<li>
<div class="<?php /* #noEscape */ echo $methodCode ?>-instructions-content checkout-agreement-item-content">
<?php /* #noEscape */ echo nl2br($block->escapeHtml($instructions)) ?>
</div>
</li>
</ul>
<?php endif; ?>
view/frontend/layout/checkout_index_index.xml
<?xml version="1.0"?>
<!--
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="checkout.root">
<arguments>
<argument name="jsLayout" xsi:type="array">
<item name="components" xsi:type="array">
<item name="checkout" xsi:type="array">
<item name="children" xsi:type="array">
<item name="steps" xsi:type="array">
<item name="children" xsi:type="array">
<item name="billing-step" xsi:type="array">
<item name="children" xsi:type="array">
<item name="payment" xsi:type="array">
<item name="children" xsi:type="array">
<item name="renders" xsi:type="array">
<!-- merge payment method renders here -->
<item name="children" xsi:type="array">
<item name="offline-payments" xsi:type="array">
<item name="component" xsi:type="string">Magento_OfflinePayments/js/view/payment/offline-payments</item>
<item name="methods" xsi:type="array">
<item name="quickpay" xsi:type="array">
<item name="isBillingAddressRequired" xsi:type="boolean">true</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</argument>
</arguments>
</referenceBlock>
</body>
</page>
view/frontend/templates/form/quickpay.phtml
<?php
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
// #codingStandardsIgnoreFile
/**
* #var $block \Magento\Quickpay\Block\Form\Quickpay
*/
$instructions = $block->getInstructions();
?>
<?php if ($instructions): ?>
<?php $methodCode = $block->escapeHtml($block->getMethodCode());?>
<div class="items <?php /* #noEscape */ echo $methodCode ?> instructions agreement" id="payment_form_<?php /* #noEscape */ echo $methodCode ?>" style="display: none;">
<?php /* #noEscape */ echo nl2br($block->escapeHtml($instructions)) ?>
</div>
<?php endif; ?>
view/frontend/web/template/payment/quickpay.html
<!--
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<div class="payment-method" data-bind="css: {'_active': (getCode() == isChecked())}">
<div class="payment-method-title field choice">
<input type="radio"
name="payment[method]"
class="radio"
data-bind="attr: {'id': getCode()}, value: getCode(), checked: isChecked, click: selectPaymentMethod, visible: isRadioButtonVisible()"/>
<label data-bind="attr: {'for': getCode()}" class="label"><span data-bind="text: getTitle()"></span></label>
</div>
<div class="payment-method-content">
<!-- ko foreach: getRegion('messages') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
<div class="payment-method-billing-address">
<!-- ko foreach: $parent.getRegion(getBillingAddressFormName()) -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
</div>
<p data-bind="html: getInstructions()"></p>
<div class="checkout-agreements-block">
<!-- ko foreach: $parent.getRegion('before-place-order') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
</div>
<div class="actions-toolbar">
<div class="primary">
<button class="action primary checkout"
type="submit"
data-bind="
click: placeOrder,
attr: {title: $t('Place Order')},
enable: (getCode() == isChecked()),
css: {disabled: !isPlaceOrderActionAllowed()}
"
disabled>
<span data-bind="i18n: 'Place Order'"></span>
</button>
</div>
</div>
</div>
</div>
js
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
/*browser:true*/
/*global define*/
define(
[
'uiComponent',
'Magento_Checkout/js/model/payment/renderer-list'
],
function (
Component,
rendererList
) {
'use strict';
rendererList.push(
{
type: 'quickpay',
component: 'Magento_Quickpay/js/view/payment/method-renderer/quickpay-method'
}
);
/** Add view logic here if needed */
return Component.extend({});
}
);
Related
I have create custom checkout Step between shipping and payment step . Now i want to show all the order details and customer fillup details.
Below is the files that i have created for the Custom checkout step
Below is the file (checkout_index_index.xml) i have created for new step in the checkout :
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="checkout.root">
<arguments>
<argument name="jsLayout" xsi:type="array">
<item name="components" xsi:type="array">
<item name="checkout" xsi:type="array">
<item name="children" xsi:type="array">
<item name="steps" xsi:type="array">
<item name="children" xsi:type="array">
<!-- The new step you add -->
<item name="my-new-step" xsi:type="array">
<item name="component" xsi:type="string">Mycustom_Checkoutnew/js/view/my-step-view</item>
<!--To display step content before shipping step "sortOrder" value should be < 1-->
<!--To display step content between shipping step and payment step 1 < "sortOrder" < 2 -->
<!--To display step content after payment step "sortOrder" > 2 -->
<item name="sortOrder" xsi:type="string">1</item>
<item name="children" xsi:type="array">
<!--add here child component declaration for your step-->
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</argument>
</arguments>
</referenceBlock>
</body>
</page>
In the second file (my-step-view.js) there will be js code as follow :
define([
'ko',
'uiComponent',
'underscore',
'Magento_Checkout/js/model/step-navigator'
], function (ko, Component, _, stepNavigator) {
'use strict';
/**
* mystep - is the name of the component's .html template,
* <Vendor>_<Module> - is the name of your module directory.
*/
return Component.extend({
defaults: {
template: 'Mycustom_Checkoutnew/mystep'
},
// add here your logic to display step,
isVisible: ko.observable(true),
/**
* #returns {*}
*/
initialize: function () {
this._super();
// register your step
stepNavigator.registerStep(
// step code will be used as step content id in the component template
'shippingaddress',
// step alias
null,
// step title value
'Shipping',
// observable property with logic when display step or hide step
this.isVisible,
_.bind(this.navigate, this),
/**
* sort order value
* 'sort order value' < 10: step displays before shipping step;
* 10 < 'sort order value' < 20 : step displays between shipping and payment step
* 'sort order value' > 20 : step displays after payment step
*/
15
);
return this;
},
/**
* The navigate() method is responsible for navigation between checkout steps
* during checkout. You can add custom logic, for example some conditions
* for switching to your custom step
* When the user navigates to the custom step via url anchor or back button we_must show step manually here
*/
navigate: function () {
this.isVisible(true);
},
/**
* #returns void
*/
navigateToNextStep: function () {
stepNavigator.next();
}
});
});
Below is the html file (mystep.html) where i want to display all the data of orders and the customer
<li id="shippingaddress" data-bind="fadeVisible: isVisible">
<div class="step-title" data-bind="i18n: 'Shipping'" data-role="title"></div>
<div id="checkout-step-title"
class="step-content"
data-role="content">
<form data-bind="submit: navigateToNextStep" novalidate="novalidate">
<div class="actions-toolbar">
<div class="primary">
<button data-role="opc-continue" type="submit" class="button action continue primary">
<span><!-- ko i18n: 'Next'--><!-- /ko --></span>
</button>
</div>
</div>
</form>
</div>
</li>
In the new custom page i want show following things
1)Email 2)Contact 3 ) Address that sellected in previous step
4)Shipping method
If anyone can help me in this then please let me know
In frontend i want to show data as per image attached. go through that image
I am trying to add my new shipping method with a map (INPOST) but I have a problem. My map won't load. Then I try to use a case with no map, with points but still not working in the checkout. I tried to do this on the product page and it worked.
My custom shipping method working good, only problem with that map
Documentation: https://docs.inpost24.com/pages/viewpage.action?pageId=7798862
Magento version: 2.3
Bellow my codes:
app/code/Kitsune/Inpost/view/frontend/layout/checkout_index_index.xml
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<script src="https://geowidget.easypack24.net/js/sdk-for-javascript.js" src_type="url" async="async"/>
<css src="https://geowidget.easypack24.net/css/easypack.css" src_type="url"/>
</head>
<body>
<referenceBlock name="checkout.root">
<arguments>
<argument name="jsLayout" xsi:type="array">
<item name="components" xsi:type="array">
<item name="checkout" xsi:type="array">
<item name="children" xsi:type="array">
<item name="steps" xsi:type="array">
<item name="children" xsi:type="array">
<item name="shipping-step" xsi:type="array">
<item name="children" xsi:type="array">
<item name="shippingAddress" xsi:type="array">
<item name="config" xsi:type="array">
<item name="shippingMethodItemTemplate" xsi:type="string">Kitsune_Inpost/custom-method-item-template</item>
<item name="shippingMethodListTemplate" xsi:type="string">Kitsune_Inpost/custom-method-list-template</item> </item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</argument>
</arguments>
</referenceBlock>
</body>
</page>
app/code/Kitsune/Inpost/view/frontend/web/js/inpost.js
jQuery( document ).ready(function() {
easyPack.init({
instance: 'pl',
mapType: 'osm',
searchType: 'osm',
points: {
types: ['parcel_locker'],
},
map: {
useGeolocation: true,
initialTypes: ['parcel_locker']
}
})
window.onload = function() {
easyPack.dropdownWidget('easypack-widget', function(point) {
console.log(point)
});
}
});
app/code/Kitsune/Inpost/view/frontend/web/template/custom-method-item-template.html
<!-- Initialize collapsible binding -->
<tbody collapsible="as: '$collapsible_' + method.method_code">
<tr class="row">
<td class="col col-method">
<input type="radio"
class="radio"
click="element.selectShippingMethod"
ifnot="method.error_message"
ko-checked="element.isSelected"
ko-value="method.carrier_code + '_' + method.method_code"
attr="'aria-labelledby': 'label_method_' + method.method_code + '_' + method.carrier_code + ' ' + 'label_carrier_' + method.method_code + '_' + method.carrier_code,
'checked': element.rates().length == 1 || element.isSelected" />
</td>
<td class="col col-price">
<each args="element.getRegion('price')" render="" />
</td>
<td class="col col-method"
attr="'id': 'label_method_' + method.method_code + '_' + method.carrier_code"
text="method.method_title" />
<td class="col col-carrier"
attr="'id': 'label_carrier_' + method.method_code + '_' + method.carrier_code"
text="method.carrier_title" />
<!-- Column with collapsible trigger -->
<td class="col">
<!-- ko if: method.carrier_code == 'kitsune_inpost' -->
<div data-bind="mageInit: {'inpost': {}}" id="easypack-widget"></div>
<h1>eloo</h1>
<!-- /ko -->
</td>
</tr>
<!-- Row for shipping method description -->
<tr class="row" visible="$context['$collapsible_' + method.method_code].opened">
<td class="col" colspan="5" i18n="'Some description.'"/>
</tr>
<tr class="row row-error"
if="method.error_message">
<td class="col col-error" colspan="5">
<div role="alert" class="message error">
<div text="method.error_message"></div>
</div>
<span class="no-display">
<input type="radio"
attr="'value' : method.method_code, 'id': 's_method_' + method.method_code" />
</span>
</td>
</tr>
</tbody>
app/code/Kitsune/Inpost/view/frontend/web/template/custom-method-list-template.html
<div id="checkout-shipping-method-load">
<table class="table-checkout-shipping-method" markdown="1"> <thead>
<tr class="row" markdown="1">
<th class="col col-method" translate="'Select Method'" />
<th class="col col-price" translate="'Price'" />
<th class="col col-method" translate="'Method Title'" />
<th class="col col-carrier" translate="'Carrier Title'" />
<!-- Column for triggers -->
<th class="col" />
</tr>
</thead> <!-- tbody was moved inside item template --> <!-- ko foreach: { data: rates(), as: 'method'} --> <!--ko template: { name: element.shippingMethodItemTemplate} --><!-- /ko --> <!-- /ko --> </table>
</div>
app/code/Kitsune/Inpost/view/frontend/requirejs-config.js
var config = {
map: {
'*': {
inpost: 'Kitsune_Inpost/js/inpost'
}
}
}
I wanted to add just comment instead of posting an answer (but I can't comment).
Wrap your js in define and check comments I added here:
define(['domReady!'], function() {
// check here via debugger if code is executed
// then you can investigate why rest isn't working
window.easyPack.init({
instance: 'pl',
mapType: 'osm',
searchType: 'osm',
points: {
types: ['parcel_locker'],
},
map: {
useGeolocation: true,
initialTypes: ['parcel_locker']
}
});
// this also won't work as you can miss onload event
window.onload = function() {
easyPack.dropdownWidget('easypack-widget', function(point)
{
console.log(point)
});
};
});
you need be sure that easyPack will be available. Do you load it synchronously? I see some async version in documentation so you need to think about that and implement it properly.
I have some trouble with a multistep form because the validation for a single step which contains a form with only radio buttons are not working :(
I have a simple property type which represent a radio button value:
class Step1Data extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
/**
* type
*
* #var string
* #validate NotEmpty
*/
protected $type;
/**
* Returns the type
*
* #return string $type
*/
public function getType() {
return $this->type;
}
/**
* Sets the type
*
* #param string $type
* #return void
*/
public function setType($type) {
$this->type = $type;
}
}
the fluid mark-up looks as follows for this step:
<f:layout name="Default" />
<f:section name="main">
<f:form action="step1redirect" class="step1" name="step1data" object="{step1data}">
<f:render partial="FormErrors" arguments="{field: 'step1data.type'}" />
<label>
<f:form.radio property="type" value="type-1" />
type 1
</label>
<label>
<f:form.radio property="type" value="type-2" />
type 2
</label>
<f:form.submit value="next" />
</f:form>
</f:section>
the controller actions for this step are:
/**
* Step1
*
* #param \Fox\Example\Domain\Model\Step1Data $step1data
* #ignorevalidation $step1data
*/
public function step1Action(\Fox\Example\Domain\Model\Step1Data $step1data = NULL) {
if ($GLOBALS['TSFE']->fe_user->getKey('ses', 'step1data') && $step1data == NULL) {
$step1data = unserialize($GLOBALS['TSFE']->fe_user->getKey('ses', 'step1data'));
}
$this->view->assign('step1data', $step1data);
}
/**
* Step1 redirect action
*
* #param \Fox\Example\Domain\Model\Step1Data $step1data
*/
public function step1redirectAction(\Fox\Example\Domain\Model\Step1Data $step1data) {
$GLOBALS['TSFE']->fe_user->setKey('ses', 'step1data', serialize($step1data));
$GLOBALS['TSFE']->fe_user->storeSessionData();
$this->redirect('step2');
}
If I add an example second property name of type string with NotEmpty annotation and a fluid textfield to this form like:
<f:layout name="Default" />
<f:section name="main">
<f:form action="step1redirect" class="step1" name="step1data" object="{step1data}">
<f:render partial="FormErrors" arguments="{field: 'step1data.type'}" />
<label>
<f:form.radio property="type" value="type-1" />
type 1
</label>
<label>
<f:form.radio property="type" value="type-2" />
type 2
</label>
<!-- EXAMPLE second property -->
<f:render partial="FormErrors" arguments="{field: 'step1data.name'}"/>
<f:form.textfield property="name" />
<!-- EXAMPLE second property -->
<f:form.submit value="next" />
</f:form>
</f:section>
the validation is working. The validation also works if I have only the textfield on this form, but if I have only the radio buttons without a textfield on this form the validation is not working and an error appears because the step1data object is null.
I don't know the reason for this weird problem, hope you can help me?
the solution is a hidden input field above the radio buttons with the same property name:
<f:form.hidden property="type" />
<div class="group-block">
<label>
<f:form.radio property="type" value="wish1" />
type1
</label>
</div>
<div class="group-block">
<label>
<f:form.radio property="type" value="wish2" />
type2
</label>
</div>
so firstly the hidden field would be checked and validated and if a radio button is checked then the type property will be overwritten
Is there anyone who can help me?
I am making a website using magento, but I am really struggeling on creating custom product tabs.
I tried using a couple of extensions such as Easy tabs and couldn't get it working.
I also tried following this http://www.joomlart.com/documentation/magento-faqs/magento-add-custom-tabs-to-product tutorial but didn't have any luck because some of the code was missing in my view.phtml.
Is there anybody who can give me a detailed explanation on this topic?
That is a complicated way to this.
First you need to create or update your local.xml file IF you do not have a local.xml file you can create one in
app->frontend->[Package Name]->[Theme Name]->layout->local.xml
Once this is created you can copy exactly what I have in this post into that file for a start of how to use one.
DO ALL UPDATES THROUGH A LOCAL.XML file not through page.xml catalog.xml, checkout.xml etc!! This will make upgrades significantly easier later down the road. Additionally, you will be able to quickly see all changes you have made to your site in one file.
Within your local.xml file
I commented what you have to do within the code / hopefully this makes it easier to understand what you are doing.
<?xml version="1.0"?>
<layout version="0.1.0">
<!-- Product Detail Page -->
<catalog_product_view translate="label">
<!-- Add Tabs -->
<reference name="product.info">
<!-- Both files that need to be created their contents are referenced below -->
<!-- Create a file named attributes.phtml in /YourPackage/Yourtheme/template/catalog/product/view/tabs.phtml -->
<block type="catalog/product_view_tabs" name="product.info.tabs" as="info_tabs" template="catalog/product/view/tabs.phtml" >
<!-- Create a file named attributes.phtml in /YourPackage/Yourtheme/template/catalog/product/view/attributes.phtml -->
<action method="addTab" translate="title" module="catalog"><alias>additional</alias><title>Specifications</title><block>catalog/product_view_attributes</block><template>catalog/product/view/attributes.phtml</template></action>
</block>
</reference>
</catalog_product_view>
</layout>
<!-- End of Local.xml -->
<!-- Contents of tabs.phtml -->
<ul class="product-tabs">
<?php foreach ($this->getTabs() as $_index => $_tab): ?>
<?php if($this->getChildHtml($_tab['alias'])): ?>
<li id="product_tabs_<?php echo $_tab['alias'] ?>" class="<?php echo !$_index?' active first':(($_index==count($this->getTabs())-1)?' last':'')?>"><?php echo $_tab['title']?></li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<?php foreach ($this->getTabs() as $_index => $_tab): ?>
<?php if($this->getChildHtml($_tab['alias'])): ?>
<div class="product-tabs-content" id="product_tabs_<?php echo $_tab['alias'] ?>_contents"><?php echo $this->getChildHtml($_tab['alias']) ?></div>
<?php endif; ?>
<?php endforeach; ?>
<script type="text/javascript">
//<![CDATA[
Varien.Tabs = Class.create();
Varien.Tabs.prototype = {
initialize: function(selector) {
var self=this;
$$(selector+' a').each(this.initTab.bind(this));
},
initTab: function(el) {
el.href = 'javascript:void(0)';
if ($(el.parentNode).hasClassName('active')) {
this.showContent(el);
}
el.observe('click', this.showContent.bind(this, el));
},
showContent: function(a) {
var li = $(a.parentNode), ul = $(li.parentNode);
ul.select('li', 'ol').each(function(el){
var contents = $(el.id+'_contents');
if (el==li) {
el.addClassName('active');
contents.show();
} else {
el.removeClassName('active');
contents.hide();
}
});
},
remoteTabs: function(b) {
var controlledLink = $$("#"+b+" a")[0];
this.showContent(controlledLink);
}
}
var productTabs = new Varien.Tabs('.product-tabs');
//]]>
</script>
<!-- End of tabs.phtml -->
<!-- Contents of attributes.phtml / This will list of all attributes -->
<?php
$_helper = $this->helper('catalog/output');
$_product = $this->getProduct()
?>
<?php if($_additional = $this->getAdditionalData()): ?>
<h2><?php echo $this->__('Additional Information') ?></h2>
<table class="data-table" id="product-attribute-specs-table">
<col width="25%" />
<col />
<tbody>
<?php foreach ($_additional as $_data): ?>
<tr>
<th class="label"><?php echo $this->escapeHtml($this->__($_data['label'])) ?></th>
<td class="data"><?php echo $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<script type="text/javascript">decorateTable('product-attribute-specs-table')</script>
<?php endif;?>
<!-- End to attributes.phtml -->
<!-- alternative contents of attributes.phtml use this to only display one specific attribute -->
<!-- Replace InstructorBio with your attribute value -->
<!-- If your attribute code is product_tab then getInstructorBio would become getProductTab instructor_bio would be product_tab -->
<?php
$_helper = $this->helper('catalog/output');
$_product = $this->getProduct()
?>
<?php if ($_additional = $_product->getInstructorBio()): ?>
<?php echo $this->helper('catalog/output')->productAttribute($_product, $_product->getInstructorBio(), 'instructor_bio') ?>
<?php endif; ?>
Now for the final step: you have to call your tabs where you want them to display Because I used the "as" name as info_tabs this is the name you reference when you call in your view.phtml file
Insert this code inside your view.phtml and you will now have tabs
<?php echo $this->getChildHtml('info_tabs') ?>
I'm trying to put an image (logo.png which is in the very same folder as index.php) in index.php (line 23):
<?php
/**
* The main template file.
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* #package WordPress
* #subpackage Starkers
* #since Starkers 3.0
*/
//$body ="home";
get_header();
//include_once 'localization.php';
?>
<div id="content">
<div class="container">
<div id="header-bottom">
<div id="slider">
<img src="logo.png"/>
</div>
<div id="tagline">
<p>This a testThis a testThis a testThis a testThis a testThis a test</p>
<p>This a testThis a testThis a testThis a testThis a testThis a test</p>
</div>
</div><!-- header-bottom -->
<div id="mainbar">
<?php
/* Run the loop to output the posts.
* If you want to overload this in a child theme then include a file
* called loop-index.php and that will be used instead.
*/
get_template_part( 'loop', 'index' );
?>
<p><?php echo $test; ?></p>
</div>
<?php get_sidebar(); ?>
</div><!-- .container -->
</div><!-- #main-content -->
<?php get_footer(); ?>
it doesn't matter if I put logo.png in the same folder as index.php the image doesn't appear
Webkit development tools says:
Resource interpreted as image but transferred with MIME type text/html.
Don't know what it means
Any suggestions?
What happens when you try:
<img src="http://www.site.com/logo.png"/>
This made it work:
<img src="<?php bloginfo('template_directory'); ?>/images/featured.png"/>
I didn't know I had to include the template_directory.