texts: unable to get value from select box in uiComponent magento (it comes with the fieldset) 2.1.8

texts:
<fieldset name="sample_fieldset">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="label" xsi:type="string" translate="true">Attribute Information</item>
        </item>
    </argument>
    <field name="attr">
        <argument name="data" xsi:type="array">
            <item name="options" xsi:type="object">vendor\module\Model\Source\option</item>
            <item name="config" xsi:type="array">
                <item name="dataType" xsi:type="string">text</item>
                <item name="label" xsi:type="string" translate="true">Select Attribute</item>
                <item name="formElement" xsi:type="string">select</item>
                <item name="source" xsi:type="string">splitattr</item>
                <item name="dataScope" xsi:type="string">attr</item>
                <item name="default" xsi:type="string">0</item>
                <item name="validation" xsi:type="array">
                    <item name="required-entry" xsi:type="boolean">true</item>
                </item>
            </item>
        </argument>
    </field>

name field shows name="sample_fieldset[attr]" but i am unable to get the selected value
here is the js code :-
 $('select[name="sample_fieldset[attr]"]').on('change', function(){
                    alert('hello13');
                });

this js alert is not pop up on changing select.


texts:
I have two simple cms blocks added into theme layout file (local.xml) under <default>:

<reference name="footer">
            <block type="cms/block" name="footer_leather_catalogo">
                <action method="setBlockId"><block_id>footer_leather_catalogo</block_id></action>
            </block>
            <block type="cms/block" name="footer_leather_catalogo_2">
                <action method="setBlockId"><block_id>footer_leather_catalogo_2</block_id></action>
            </block>
</reference>

In addition I remove them in two pages: the HP and a custom page of my module:

<reference name="footer">
<remove name="footer_leather_catalogo" />
<remove name="footer_leather_catalogo_2" />
</reference>

In HP, to show the blocks in the right place, after removed them, I add them again:

<div class="inner-container">
{{widget type="cms/widget_block" template="cms/widget/static_block/default.phtml" block_id="66"}}
{{widget type="cms/widget_block" template="cms/widget/static_block/default.phtml" block_id="67"}}
</div>

All works fine but if I apply some catalog rules (or any other actions that needs clear the cache) and flush Magento cache, I see the blocks into custom pages and twice into HP.
If I flush Magento cache again, two or three times, they disappear, and again.. flush Magento cache, they are shown in custom page and HP (twice)..

I don't understand how to solve this tedious issue.


texts: Style select-values of simple products within a bundle product

texts:
I am using simple products within my bundled products. As there are multiple Options I do get a select-list, that's not really well readable. An actual example is something like that:

<option value="128">Jeans Name -46-grey_black &nbsp; +44,99&nbsp;€</option>

This code says:

"Simple Products' title"+"-"+size-attribute+"-"color-attribute-code+" &nbsp; +"+Final Price

I'd love to have that a bit more readable. By saying this:

"Simple Products' title"+" The size: "+size-attribute+" The color: "color-attribute-name+" &nbsp; +"+Final Price

I output the option values by this code coming from the select.phtml

<?php foreach ($_selections as $_selection): ?>
        <option value="<?php echo $_selection->getSelectionId() ?>"<?php if ($this->_isSelected($_selection)) echo ' selected="selected"' ?><?php if (!$_selection->isSaleable()) echo ' disabled="disabled"' ?>><?php echo $this->getSelectionTitlePrice($_selection, false) ?></option>
    <?php endforeach; ?>

Where would I need to change things to get this change done?
Thanks!


texts: Getting the text label from attribute id

texts:
On a category page if I use the layered navigation and filter I get a URL like /men?product_attributes=141

My question is how can I get the label of the product attribute 141


texts:
I need help with the process moving a live magento shop to a new server/host. I received all the magento files from the current host of the webshop some weeks ago.. Still trying to figure out the process of how to do it.

I have setup a new server, uploading all files I received and uploading the database. But how is the process now? What happend with the orders and new customers since I received the files in october? Can someone please tell me the way to go, so the transfer will be withhout problems and without loss of data?

After all is setting up, I will change the nameservers where the domain is now to my new server. I also have the magento admin access to the existing server.

Thanks.


texts: How to add product to cart by product id and customer id?

texts:
I want to add a product to customer cart by product id and customer id
I think that way should be like this

load quote session and set customer id and then add product .

can you help me to do this ?


texts: Set custom attribute value for a product programatically in magento 2

texts:
I have created custom attributes for a product. I am doing product import programmatically.
How to set value for the custom attributes programmatically in magento 2.


texts: Magento 2: Advanced JS Bundling Automate

texts:
I am implementing Advanced JS Bundling in my Magento 2.3.2 EE store.
The part in which we create build.js on root by combining nodes of deps, shim, paths, and map from requirejs-config.js . I want to automate this, since manually it takes a lot of time to copy and paste these nodes to my build.js file.
Anyone made any script for this?


texts:
Edit : about the possible duplicate !

I would like to mention that this answer does not answer my question, if someone sees that it is the same thing, I invite him to answer me instead of saying that he is duplicated and we will see if it solves my problem.

I think that when looking for something, the first reflex is to search if there was already the same question as mine that was asked before, and I saw this post and it does not answer my problem! and even more there is not a reliable answer or accepted !

Does anyone ever work or still work with the liveReload via grunt ?

I have some problem, i don't know why but the liveReload dont refresh th content changed automatically.
I have grunt installed and it works fine i can clean, exec, etc but, when i enter: grunt watch he watch well the changes, example: if i change mycustom.css, he display :

      File "pub/static/frontend/Package/theme/fr_FR/css/mycustom.css" changed. Completed in 0.001s at Wed Mar 21 2018 16:08:58 GMT+0100
      (CET) - Waiting...

But he doesn't refresh the page,(when i refresh it manually, i see well my changes) is there a configuration to do in grunt or in the server ?

I also wanted to mention that the liveReload browser extension  is well installed but does not work, ie when I press on a logo, it shows me an error message:

  Could not connect to LiveReload server. Please make sure that
  LiveReload 2.3 (or later) or another compatible server is running.


texts: Magento 2 layered navigation price filter issue

texts:
Price filter show negative pricing like -1000- -01 and  so on
I have some configurable products in Magento 2 and it shows negative pricing in layered navigation filter.
Please find screenshot attached

Please suggest me some solution.


texts: Installing extensions via Magento connect not working after update to 1.9.2.0

texts:
After updating to Magento 1.9.2.0 the below mentioned issues
cannot install any extension from connect manager:

  Unknown cipher in list: TLSv1 failed error.


texts: Delete order by using order id and MySQL query

texts: How to delete order in magento from order id 100000030 to 100000050 by using MySQL query.


texts: Magento 2 : Assets with specifc string in file name 404 in admin

texts:
Got a strange scenario on magento install

A couple of assets in the backend 404 which means you can't edit products

/pub/static/adminhtml/Magento/backend/en_GB/Magento_ConfigurableProduct/js/variations/variations.js
/pub/static/adminhtml/Magento/backend/en_GB/Magento_Variable/variables.js

The only reason we can can see is because they contain the string var in the name.

If you rename them they load.

Can't figure out why.

cPanel server
Apache
php 7.1
Magento 2.2.3

Any ideas?


texts: Is Magento2 over-complicated, over-engineered, and bloated?

texts:
Does it really take this much code to display a product title on a product detail page with Magento2?

And then that much code for pretty much every other piece of information that displays on each page? And then a never ending folder structure full of tiny files that reference other tiny files.

I understand it's very flexible and generating and caching static files but why so much code just to display one field from a database?

And then something the h1 which should be set in an admin setting tag is hard coded... it seems on the surface that it wasn't thought out very well and over-coded for theme developer flexibility instead of actual users.

I'm thrilled with the potential flexibility but it takes way too much time and effort to become a real end user / developer :(


texts:
I am working on a jewelry shop, and as we all know that Gold prices fluctuate every day so is there any way to address this matter?
Is there any way to update product prices based on gold rate in real time or at least once in a day?

Please help, any suggestions in this regard will be highly appreciated,


texts:
I installed an extension a while ago, which continues to throw back errors every time I try to configure it. When I go to backend, and then select "Shipping Methods" and then from the top left drop down "Default Website > Main Website" I get an exception thrown back at me, I've attempted to find the issue and after many hours of searching, I've failed to find anything close to a resolution.

This is the error -

Invalid config field backend model:
dpd/adminhtml_system_config_backend_shipping_dpdclassic_tablerate

Trace:
#0 /html/magento/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php(328): Mage::throwException('Invalid config ...')
#1 /html/magento/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php(229): Mage_Adminhtml_Block_System_Config_Form->initFields(Object
(Varien_Data_Form_Element_Fieldset), Object(Mage_Core_Model_Config_Element), Object(Mage_Core_Model_Config_Element))
#2 /html/magento/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php(164): Mage_Adminhtml_Block_System_Config_Form->_initGroup(Objec
(Varien_Data_Form), Object(Mage_Core_Model_Config_Element), Object(Mage_Core_Model_Config_Element))
#3 /html/magento/app/code/core/Mage/Adminhtml/Block/System/Config/Edit.php(92): Mage_Adminhtml_Block_System_Config_Form->initForm()
#4 /html/magento/app/code/core/Mage/Adminhtml/controllers/System/ConfigController.php(107): Mage_Adminhtml_Block_System_Config_Edit->initForm()
#5 /html/magento/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Adminhtml_System_ConfigController->editAction()
#6 /html/magento/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('edit')
#7 /html/magento/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object
Mage_Core_Controller_Request_Http))
#8 /html/magento/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#9 /html/magento/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#10 /html/magento/index.php(90): Mage::run('', 'store')
#11 {main}

Perhaps someone could help me with this and find a fix? I've contacted the plugin creators but been given the whole "It's not our problem" run around.


texts: Magento 2 checkout - move Shipping methods block

texts:
I am trying to move the Shipping methods block higher up the page of the onepagecheckout.

I have tried using the "displayArea" item to move it but it didn't work.

<item name="displayArea" xsi:type="string">customer-email</item>

I can't even see anywhere in the checkout_index_index.xml that references this block to render.

I have also tried moving it within the shipping.html file. After publishing static content and clearing cache nothing changed.

Any pointers? Thanks


texts: Webinse | Discussion on Region and City Manager for Magento 2 installation

texts:
I have purchesed this extention and try to install it on my magento 2.2 site.

but its not working, I need an installation guide to complete this. if anyone have used this extension please provide some information.


texts: Magento 2: How to display the all product review and rating on Home Page?

texts: How to display all product reviews and ratings on the home page like below image?


texts: Use Default Value checkbox for custom category ui_component

texts:
I added a custom category attribute "Listing Image" and want to display the checkbox "Set Default Value", like "Thumbnail" and "Category Image". I already compared the ui_component, but couldn't find the entry for that.

<?xml version="1.0" ?>
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <fieldset name="content">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="label" xsi:type="string" translate="true">Content</item>
                <item name="collapsible" xsi:type="boolean">true</item>
                <item name="sortOrder" xsi:type="number">10</item>
            </item>
        </argument>
        <field name="listingimage">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="dataType" xsi:type="string">string</item>
                    <item name="source" xsi:type="string">category</item>
                    <item name="label" xsi:type="string" translate="true">Listing Image</item>
                    <item name="visible" xsi:type="boolean">true</item>
                    <item name="formElement" xsi:type="string">fileUploader</item>
                    <item name="elementTmpl" xsi:type="string">ui/form/element/uploader/uploader</item>
                    <item name="previewTmpl" xsi:type="string">Magento_Catalog/image-preview</item>
                    <item name="sortOrder" xsi:type="number">45</item>
                    <item name="required" xsi:type="boolean">false</item>
                    <item name="uploaderConfig" xsi:type="array">
                        <item name="url" xsi:type="url" path="categorylandingpage/category/upload/attribute_code/listingimage"/>
                    </item>
                    <item name="scopeLabel" xsi:type="string">[WEBSITE]</item>
                </item>
            </argument>
        </field>
    </fieldset>
</form>


texts: How to get sum of particular column (custom model)?

texts:
I have custom model with 4 fields(a,b,c,d).
I need sum of "d" field.
So my solution using collection loop the d values and make the sum.For this is any simple solution?
Thanks in advance.

  $available=0;
    $pieces = Mage::getResourceModel('rad_inventorypieces/piece_collection')
    foreach($pieces as piece)
    {

$available=+$piece->getAvailable();
    }


texts:
I have an issue. I put some custom links to my header.
It looks like this for all my web-site pages now:
http://joxi.ru/52aRPqZu4kVjlA

However, for some reason on my home page those links are not showing.

What can be wrong there?

To configure my custom links I used this path:

/home/[my_theme]/public_html/vendor/magento/module-theme/view/frontend/templates/html/header/

File: logo.phtml

But it looks like header for the main page is generated from some other place... Can't find it. Could anyone help me?

Web-site: https://tangs.com.au/


texts: Getting order id for guest checkout order

texts:
I need to assign a Guest Order to a Customer, so i found this link

  How to assign a Guest Order to a Customer - Magento 2

Using SQL

UPDATE sales_order SET customer_id = {YOUR CUSTOMER ID}, customer_is_guest = 0 where entity_id = {YOUR ORDER ID};
UPDATE sales_order_grid SET customer_id = {YOUR CUSTOMER ID} where entity_id = {YOUR ORDER ID};

Using PHP (if customer exist)

public function __construct(
.....
\Magento\Sales\Api\OrderRepositoryInterface $orderRepository,
\Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder
 ) {
...
$this->orderRepository = $orderRepository;
$this->searchCriteriaBuilder = $searchCriteriaBuilder;
 }

 public function execute()
{
  $incrementId = {YOUR ORDER ID};
  $customerId = {YOUR CUSTOMER ID};

  $searchCriteria = $this->searchCriteriaBuilder->addFilter('increment_id', $incrementId, 'eq')->create();
  $order = $this->orderRepository->getList($searchCriteria)->getFirstItem();

 if ($order->getId() && !$order->getCustomerId())
 {
    $order->setCustomerId($customerId);
    $order->setCustomerIsGuest(0);
    $this->orderRepository->save($order);
 ...

From the above two solutions
For 1st solution (SQL)

Where should I write SQL query so that it updates the tables sales_order and sales_order_grid before my myaccount phtml loads so that guest orders will be displayed.
How can I get ORDER ID for guest checkout order as I need to update the sales_order table for guest order entity id.

I tried this code

 public  function  getOrderId() {
  $order = $this->_checkoutSession->getLastRealOrder();
  $orderId=$order->getEntityId();
  return $orderId;
}

But this doesnt give any order id. Altough I am able to get customer id.

For 2nd solution (PHP)

I am not able to get order id (entity_id).

How can I resolve these issues.


texts: Translate Validation Error Message of Date of Birth

texts:
I got a problem to translate validation error message "Please enter a valid full date." in the edit account page. This message will be prompted when user leave Date of Birth field is empty.

That field was using js/varien/js.js to validating the user input. I failed to translate the error message which was assigned to a JavaScript variable namely, error.

(js.js code in Magento ver 1.7.0.2)

    validate: function() {
    var error = false,
        day = parseInt(this.day.value.replace(/^0*/, '')) || 0,
        month = parseInt(this.month.value.replace(/^0*/, '')) || 0,
        year = parseInt(this.year.value) || 0;
    if (!day && !month && !year) {
        if (this.required) {
            error = 'This date is a required value.';          <------ (Line: 445)
        } else {
            this.full.value = '';
        }
    } else if (!day || !month || !year) {
        error = 'Please enter a valid full date.';          <------ (Line: 450)

For above error messages, simply adding translation text into translate.csv did not work. Please help how to translate these strings without changing the core code.


texts: Custom variable in block always giving last requested value in phtml file

texts:
I've injected custom variable named slider_id to my block like below,

    <reference name="content">
         <block type="sliderpro/sliderpro" name="defaultslider" as="defaultslider" before="-" template="sliderpro/defaultslider.phtml" >
               <action method="setData"><name>slider_id</name><value>1</value></action>
         </block>
         <block type="sliderpro/sliderpro" name="defaultslider" as="defaultslider" before="-" template="sliderpro/defaultslider.phtml" >
                <action method="setData"><name>slider_id</name><value>3</value></action>
          </block>
     </reference>

Under defaultslider.phtml,

echo $this->getSliderID(); // Outputs 3

I need to grab both the requested slider_id's  i,e 1 & 3.

Any idea how to achieve this ?


texts: Magento 2.2.4 - Discount Code not working on checkout page

texts:
We have a discount code and it works in the view cart page but doesn't work in the checkout/#payment.

In fact no action is taken when we click on Apply discount. Does anybody know the solution for this.


texts: Incorrect prices in shopping cart via SOAP API v2

texts:
Store have configurable product, which costs 750 ("base version"), via API I want to buy configured product, which costs 1500. When I just try to get shoppingCartTotals(), I get right prices (with right tax), but when I try to get shipping and payment methods - prices changing.

Here is code:

<?php

$proxy = new SoapClient('http://example.com/index.php/api/v2_soap/?wsdl');
$sessionId = $proxy->login('ApiUser', 'ApiKey');

$quoteId = $proxy->shoppingCartCreate( $sessionId, 3 );

/*$customerData = array(
    "firstname" => "-",
    "lastname" => "-",
    "email" => "guest@example.com",
    "mode" => "guest",
    "website_id" => "0"
);*/

//$proxy->shoppingCartCustomerSet($sessionId, $quoteId, $customerData);

$proxy->shoppingCartCustomerAddresses($sessionId, $quoteId, array(array(
    'mode' => 'billing',
    'firstname' => '-',
    'lastname' => '-',
    'street' => '-',
    'city' => '-',
    'region' => '-',
    'postcode' => '-',
    'country_id' => 'UK',
    'telephone' => '-',
    'is_default_billing' => 1
)));

$proxy->shoppingCartProductAdd(
    $sessionId,
    $quoteId,
    array(
        array(
            'sku' => '111111',
            'qty' => '1',
            'options' => array(
                array(
                    "key" => 111,
                    "value" => 1212,
                )
            ),
        )
    ),
    3 //storeId

);
//Uncomment following lines for price changing
//$result_payment = $proxy->shoppingCartPaymentMethod($sessionId, $quoteId, array('method' => 'checkmo'), 3);
//$result_shipping = $proxy->shoppingCartShippingMethod($sessionId, $quoteId, 'freeshipping_freeshipping', 3);
//echo var_dump(array('shoppingCartPaymentMethod' => $result_payment,'shoppingCartShippingMethod' => $result_shipping));

//$result = $proxy->shoppingCartInfo($sessionId, $quoteId, 3);
//var_dump($result);

$result = $proxy->shoppingCartTotals($sessionId, $quoteId, 3);
var_dump($result);

And here is results:

Without shipping and payment methods:

  array(3) {
  [0]=>
  object(stdClass)#2 (2) {
    ["title"]=>
    string(8) "Subtotal"
    ["amount"]=>
    float(1500)
  }
  [1]=>
  object(stdClass)#3 (2) {
    ["title"]=>
    string(3) "Tax"
    ["amount"]=>
    float(300)
  }
  [2]=>
  object(stdClass)#4 (2) {
    ["title"]=>
    string(11) "Grand Total"
    ["amount"]=>
    float(1500)
  }
}
With shipping and payment methods:

  array(2) {
  ["shoppingCartPaymentMethod"]=>
  bool(true)
  ["shoppingCartShippingMethod"]=>
  bool(true)
}
array(4) {
  [0]=>
  object(stdClass)#2 (2) {
    ["title"]=>
    string(8) "Subtotal"
    ["amount"]=>
    float(780)
  }
  [1]=>
  object(stdClass)#3 (2) {
    ["title"]=>
    string(3) "Tax"
    ["amount"]=>
    float(156)
  }
  [2]=>
  object(stdClass)#4 (2) {
    ["title"]=>
    string(40) "Shipping & Handling (Fri frakt - Gratis)"
    ["amount"]=>
    float(0)
  }
  [3]=>
  object(stdClass)#5 (2) {
    ["title"]=>
    string(11) "Grand Total"
    ["amount"]=>
    float(780)
  }
}

What am I doing wrong?


texts: Success/Error message not showing up in Magento version 2.3.6-p1 while login, registration and subscription

texts:
I installed a fresh Magento instance and noticed there are no messages (error/success) is showing up while a new customer registration, login with wrong email/password, submit mail to the subscription list, etc.
In my findings, Magento generates mage-messages cookie which is responsible for holding the session message but the problem is Magento generates two same-name cookies mage-messages where the first one has the message but the second has an empty value. Any workaround over there? Thank You.


texts: Overriding Default.xml removes Sign In link from header - Magento 2.2.3

texts:
I'm building a theme off the back of Luma. I'm mainly doing a few colour changes and moving a few elements around.

When I override the following, it removes the 'Sign In' link from the header:

Magento_Theme/layout/default.xml

Another weird behaviour is:

If I take out my overriding default.xml, redeploy the website (flush the cache etc), the link comes back, then when I put my default.xml back in and redeploy, the link stays until I flush the cache, it then disappears.


texts: Magento users/permissions web server & group

texts:
So a prior question led me to this, I am trying to use Magento2, (very frustrating)

I have a VPS, with all the proper things for Magento2 to run.

I can install it but have huge permissions issues, because the part of the documentation I cannot understand is the part about Put the Magento file system owner in the web server's group

http://devdocs.magento.com/guides/v2.0/install-gde/prereq/apache-user.html#install-update-depend-user-add2group

when I do:
    [~]# egrep -i '^user|^group' /etc/httpd/conf/httpd.conf

I get:

User nobody
Group nobody
UserDir
public_html
UserDir
disabled
UserDir disabled

and I don't know how to proceed from here.

Any help would be appreciated.

UPDATE### I have now completely started over... I wiped the host account clean and created a new one, starting from scratch, trying to follow the install directions from magento. everything is good up until the point where I have to: Put the Magento file system owner in the web server's group - I'm stuck there, since my user and group are both "nobody" I don't know what to do next, is says to do this THEN install magento... so I'm just stuck here now.


texts: Magento 2 Bypass CSRF Validation code clears the customer session

texts:
We have created one custom controller in Magento 2.3.x which we have added code to bypass CSRF Validation and we are passing data from an external website to this controller as POST. As we know Magento 2.3.x does not allow POST data from external URLs if we do not bypass CSRF, that is why we bypass it and that controller is calling properly and we are also getting post data into that controller.
But now the issue is the session of the customer is cleared and the customer logged out automatically when the external website passes data to that controller.
Can anyone face a similar issue? if yes then it will be much appropriated if you shared a possible solution with us.


texts: Magento2 product added to comparison message in Modal popup

texts:
Magento2 product added to the comparison message in Modal popup.
I need to display message in modal popup


texts:
Is it possible to run the Magento admin from a subdomain?
I.E.
https://d1.com - live site
admin;
https://backend.d1.com/admin

I've attempted alias/park domain and a view other things (of course setting the custom url in Config > Admin ) but it usually just gets stuck in a redirect loop going to https://backend.d1.com/admin

Any advice would be greatly appreciated.


texts:
I'm struggling with the product pages. When I click on any book in the store, I am getting a message that says Http Error 500. It's happening on every product page.
I read that this was caused by not enough memory for the site. The .htaccess file had more memory listed than the 256MB recommended by the other sites. They also recommended renaming the .htaccess file, but when I did that, I started getting a different area of too many redirects. So I tried deleting cookies, etc, but that did nothing to help. The redirect issue went away as soon as I renamed the file back to its original name.
I've attached the error page. Is this a memory problem, or is this possibly a redirect or incorrect URL problem?
Thanks in advance,


texts: Magento 2: How to call function in phtml file from parent block

texts:
I have create a block which contains a phtml file.This .phtml file called other phtml file.

Please check code :

block name : ..\block\country.php

This block has a template file, name : country.phtml
Code in this file

<?php
    echo $this->getLayout()->createBlock("Magento\Framework\View\Element\Template")->setTemplate("Namespace_Module::state.phtml")->toHtml();
?>

As you seen country.phtml file call state.phtml file.

Now issue is, if I want to use any function of parent block country.php in state.phtml file then I am getting an error.

So please help me how can I called functions of parent block country.php

Thank you.

If I set state.phtml in country.phtml like

<?php
echo $this->getLayout()->createBlock("Namespace\Module\Block\Country")->setTemplate("Namespace_Module::state.phtml")->toHtml();
?>

Then Is it possible to call functions of Country.php in State.phtml file ?


texts: Default Gateway Time-out on checkout page

texts:
I am getting this error when I try to check out ,any help would be greatly appreciated

Gateway Time-out

The gateway did not receive a timely response from the upstream server or application.

Thanks


texts:
I need to update mini cart without the need to click on update button (just clicking on +/- button)

I can't find module or code to do that!


texts: Magento 2: After placing order it is take too much time to redirect to order success page

texts:
I'm developing single store magento site. In checkout process i'm using 2 payment method those are paypal and eway. And my only shipping method is flat rate method.

When I go to checkout page all working properly but after placing order user have to wait 3 or 4 minutes to redirect to order success page.

Please Help me to reduce this time. Much appreciated you help, Thanks in Advance :)


texts:
When trying to save the backend product attribute, it says saved but the same settings are there. I try to change from visual swatch to text swatch, and it saves the text swatch but doesn't update the attributes:

I dont know where I can start looking for this problem.


texts: Max number of items per filter in layered navigation

texts:
I would like to have a maximum number of items, say 10, per filter in layered navigation with a More... link that would then load all of the items for that filter.
This would be really useful for the brands filter as there are a lot of them.

Any info/tutorials would be greatly appreciated!


texts: Why do I get "SOAP-ERROR: Parsing WSDL: Couldn't find "?

texts:
I am trying to set up a SOAP client on one server to communicate with Magento on a test server. Both servers have PHP's SOAP extension installed, configured and show up in phpinfo().

Tried turning off caching, using the v2 and v1 APIs and everything else I could think of. Regardless, I keep getting the same problems.

Either its:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Body>
        <SOAP-ENV:Fault>
            <faultcode>SOAP-ENV:Server</faultcode>
                <faultstring>
                    Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL:
                    Couldn't find <definitions> in 'http://myserver.com/api/v2_soap?wsdl=1'
                    in dispatch.php:39

                    Stack trace: #0 dispatch.php(39):
                    SoapClient->SoapClient('http://myserver.com/...', Array) #1 {main} thrown
                </faultstring>
        </SOAP-ENV:Fault>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

or sometimes another error SOAP doesn't allow DTD....

I'm now using just the plain Magento example code from here, instead of running anything significant, until I can figure out what's going on with this.

If I do file_get_contents to the service URL, I get:

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns:typens="urn:Magento" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" name="Magento" targetNamespace="urn:Magento">
    <types>
    <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:Magento">
        <import namespace="http://schemas.xmlsoap.org/soap/encoding/" schemaLocation="http://schemas.xmlsoap.org/soap/encoding/"/>
        <complexType name="associativeEntity">
        <all>
            <element name="key" type="xsd:string"/>
            <element name="value" type="xsd:string"/>
        </all>
        </complexType>
        .
        .
        .
</definitions>

So seems like it should not have trouble parsing this.. idk.


texts: Products showing out of stock even though they are in stock

texts:
I have created a Configurable Product and used the simple import tool (System->Import/Export) to import the Simple Products that will be associated with the Configurable Product.  I am able to associate the Simple Products to the Configurable Product without any issues, however when I look at the front-end it shows out of stock.  I have been troubleshooting this for days now and found an odd occurrence.  If I go into a Simple Product, switch 'Choose Store View' from Default to the actual store I want it to show up on, and click Save (no other modifications made) the product is available for attribute selection containing the 1 Simple Product that I saved.  I have re-imported the Simple Products several times (including putting the store name in the '_store' variable) however nothing has worked.

Does anyone know what may be being set in the DB when saving a Simple Product with a 'Choose Store View' option selected?  I have a lot of products that I need to import and have everything mapped beautifully, I just can not set this 1 variable.  Any help is greatly appreciated.


texts: Add many Store Views: what is the impact on performance?

texts:
Suppose I have a Magento installation organized like this:

-> `website` W
-->`store`   S
---> `store view` A
---> `store view` B

... and I decide to add 50 more Store View to the Store S

How much this change is going to impact on the performance ?
What I should take care of  ?

UPDATE
I'm trying to summarize all the shared points:

More Product Flat tables -> re-index slower / more HD space
Bigger Product Attribute tables -> some query slower / more HD space
More cache records -> slower cache / more HD space
possible impact on price index ( if websites number is increased too )


texts: Downloading product adds “attachment” word to file name in chrome

texts:
Hi i have downloadable products in my store. When customer download products except from chrome it's work fine.
but when customer downloads products from chrome then it adds "attachment" word like (abc.mp3, attachment). I userd default
function of magento for download

$sampleId = $this->getRequest()->getParam('sample_id', 0);
    $sample = Mage::getModel('downloadable/sample')->load($sampleId);
    if ($sample->getId()) {
        $resource = '';
        $resourceType = '';
        if ($sample->getSampleType() == Mage_Downloadable_Helper_Download::LINK_TYPE_URL) {
            $resource = $sample->getSampleUrl();
            $resourceType = Mage_Downloadable_Helper_Download::LINK_TYPE_URL;
        } elseif ($sample->getSampleType() == Mage_Downloadable_Helper_Download::LINK_TYPE_FILE) {
            $resource = Mage::helper('downloadable/file')->getFilePath(
                Mage_Downloadable_Model_Sample::getBasePath(), $sample->getSampleFile()
            );
            $resourceType = Mage_Downloadable_Helper_Download::LINK_TYPE_FILE;
        }
        try {
            parent::_processDownload($resource, $resourceType);
            exit(0);
        } catch (Mage_Core_Exception $e) {
            $this->_getSession()->addError(Mage::helper('downloadable')->__('Sorry, there was an error getting requested content. Please contact the store owner.'));
        }
    }
    return $this->_redirectReferer();


texts: how to send custom email no template in magento2?

texts:
In magento2 send email with contact module  use:

$transport = $this->_transportBuilder
                ->setTemplateIdentifier($this->scopeConfig->getValue(self::XML_PATH_EMAIL_TEMPLATE, $storeScope))
                ->setTemplateOptions(
                    [
                        'area' => \Magento\Backend\App\Area\FrontNameResolver::AREA_CODE,
                        'store' => \Magento\Store\Model\Store::DEFAULT_STORE_ID,
                    ]
                )
                ->setTemplateVars(['data' => $postObject])
                ->setFrom($this->scopeConfig->getValue(self::XML_PATH_EMAIL_SENDER, $storeScope))
                ->addTo($this->scopeConfig->getValue(self::XML_PATH_EMAIL_RECIPIENT, $storeScope))
                ->setReplyTo($post['email'])
                ->getTransport();
$transport->sendMessage();

So i have create custom send email it not have template. but i don't know how do send email with transportBuilder is true.

this's data i want send.

$myData = Array (
   [to] => xxx@gmail.com
   [email] => admin@gmail.com
   [subject] => Magento Commerce
   [headers] => array(
            [reply_to] => admin@gmail.com
            )
   [body] => {{template config_path="design/email/header_template"}}
              {{depend Magento Commerce}} Magento Commerce {{/depend}}
                Name:   ABC
                Email:  abc@gmail.com
                Subject:    Magento Commerce
                Message:    Sample text.
            {{template config_path="design/email/footer_template"}}
 [type] => text/html
  [attachments] =>
)

How do i can send email with $myData use transportBuilder. Many thank!!


texts: M2 | How to find referenceBlock name for the Sales Order View : Account Information Section?

texts:
Part1: I need to know the referenceBlock name for:

Part 2: and put a button at:

“If you have knowledge, let others light their candles in it.”
― Margaret Fuller


texts: Set position or order of a new tab on the product detail page in Magento2

texts:
I am adding an alternate reviews tab to the product detail page, and I have the tab appearing, but it always renders as the first tab in the list, the leftmost.  I'd like it to be at the end, after (or in place of) the standard Reviews tab.

<referenceBlock name="product.info.details">
    <block class="My\Module\Block\Reviews" name="my.reviews.tab" as="my_reviews" template="My_Module::reviews.phtml" group="detailed_info">
        <arguments>
            <argument translate="true" name="title" xsi:type="string">Reviews</argument>
        </arguments>
    </block>
</referenceBlock>

I've dug around in the mage-catalog and mage-reviews code, but I can't find an argument I can pass to change this.


texts: How could I define the "resource" for Token-based authentication in webapi.xml?

texts:
I created a custom REST Web Service in Magento2.1 Community. In webapi.xml, I have so defined:

<route url="/api/updateProductPriceByID" method="POST">
    <service class="CompanyName\WebService\Api\ProductInterface" method="updateProductPriceByID"/>
    <resources>
        <resource ref="CompanyName_WebService::manage"/>
    </resources>
</route>

For Authentication, I created a Role and a User in Admin Panel:

Role Name: Webservice Role
User Name: wsuser

With this user, I can get Admin Token, Here is no problem.

Request: POST /V1/integration/admin/token
Response: 6f7jecvafar79nr61g76fbtukswighrp (for example)

And now I want to call this API with my Admin Token, I got error:

{"message":"Consumer is not authorized to access %resources","parameters":{"resources":"CompanyName_WebService::manage"}

How could solve this problem?
I think I did wrong with resources in webapi.xml.
But how could I define resources in webapi.xml?
Thanks a lot!!!


texts: Which Version should I Upgrade to 2.1.10 or 2.2

texts:
My current Magento installation is 2.1.7 CE, and my website does not require any B2B features available in 2.2.

So should I update to 2.2 or 2.1.10 ?

Will all the security patches, be available for 2.1.10

If I should upgrade it ? Is there any noteworthy performance improvement in 2.2 ?


texts: Calculate product price from several fees

texts:
My products have a base price, but each product can have additional fees, like costs for the packaging or for special delivery conditions (Dangerous Goods Fee). How can I calculate the final product price dynamically by using all my costs?

Christian


texts: Catalog needs to support pricing with 13 decimal points. after point

texts:
Business Requirement: Our catalog needs to support pricing with 13 decimal points.

Currently We are using magento 2.1 version community edition, but we have issues while saving the price with more than 4 decimal points in the backend and frontend.

As per our requirement, We need to save the price for the product with 13( 0.000056784325 ) decimal places after the decimal point.


texts: Inserting Magento widget inserts image of widget and not the widget itself

texts:
I'm trying to add extension widget to CMS page, but for some reason it just inserts image of Magento widget to CMS page content. If I hide editor code shows:

So on actual page where widget should be displayed I can only see Magento widget icon. It doesn't matter what widget I try to insert, result is always same. I have many extensions, but none of them has anything to do with widgets.


texts: Invalid form key please refresh the page magento2

texts:
Can any one help me for below issue

while saving the product iam getting :

  Invalid form key Please refresh the page

page is not saving

I was also tried by changing the max_input_vars

Help me great thanks in advance


texts: Magento 2.2.1 Checkout page broken and Js fail to load error

texts:
I have installed Magento 2.2.1  and set up my custom theme but checkout page looks broken and consoles showing errors:

Not sure how to resolve this issue.  Need help how can this be resolved.

How can i trace it?


texts: Magento 2: How to differentiate the app and web based orders?

texts:
How to identify whether the order is placed from an app or website?

I want to add one custom column in admin sales order grid. And the column displays the values for order source(app or website order).

How to get the order is placed from web or app?

Thanks.


texts: Magento 2 Cybersource - Create Payment Programatically

texts: We have a custom invoice payment section, where customers will pay their outstanding invoices through Credit Card. How can we create a payment on this page using the Cybersource Payment method?


texts: Magento create order programatically. getPayment()->importData too slow

texts:
I'm creating orders programatically in magento but when I have to assign the payment method it will takes 10 to 50 minutes. I use:

$quote->getPayment()->importData(array('method' => 'banktransfer'));

Is posible to avoid the import data stament and use preformated array like in billing address, see example:

$addressData = array(
        'firstname' => $customer->getFirstname(),
        'lastname' => $customer->getLastname(),
        'street' => $pedido->ID,
        'city' => 'Ciudad',
        'postcode' => '123456',
        'telephone' => '123456',
        'country_id' => 'ES',
        'region_id' => 12, // id de la tabla directory_country_region
);
$shippingAddress = $quote->getShippingAddress()->addData($addressData);

Any idea about the payment array fields?

Thanks


texts: Add Virtual products to cart with custom options programmatically

texts:
I am working on the virtual products add to cart.  I had written my custom code for add to cart and called the function on ajax call.Below is the code for the addtocart

$_product = Mage::getModel('catalog/product')->load($proid);
$_product->setIsRecurring('1');
$_product->setRecurringProfile(array(
    'start_date_is_editable' => 0,
    'schedule_description' => "Test",
    'suspension_threshold' => 1,
    'bill_failed_later' => 1,
    'period_unit' => day,
    'period_frequency' => 12,
    'period_max_cycles' => 1
));

$_product->save();
    $params = array(
        'product' => $proid, // This would be $product->getId()
        'qty' => 1,
);

$cart = Mage::getModel('checkout/cart');
$cart->init();
$cart->addProduct($_product,$params);
$cart->save();
Mage::getSingleton('checkout/session')->setCartWasUpdated(true);

Now when i am adding this product to cart i am getting following error.

a:5:{i:0;s:46:"Please specify the product required option(s).";i:1;s:1227:"#0

when i had looked why this is happening i had found that i had specified custom options for the products and it is specified as Required.Please See Below Image.

see the product page.this is not the default product page of magento. the product page is as follow

how can i set the selected custom option value to cart.which is required.

Please Help Me.

I tried many solutions but not worked.

Thanks


texts: Magento Community 1.9.1 RWD theme: Home page "add to cart" formatting not correct on Iphone or android

texts: When I test the site for responsiveness and formatting on a pc, The smallest screen size settings shows proper formatting for my products under "New Products" widget on my home page. But when I actually use an Iphone or Android device, the formatting under each product image isn't correct. Any Suggestions?


texts: Product Prices Not Showing On Category Pages

texts:
I can't seem to find anyone else that has had this problem. But I noticed my category pages are not showing the product prices.  <?php echo $this->getPriceHtml($_product, true) ?> works on any custom templates I've created but not on the category pages. Must be a setting I'm overlooking?

How come <?php echo $this->getPriceHtml($_product, true) ?> isn't working on the category pages?


texts: Add a product collection to customer entity type

texts:
I would like to allow a logged in user to select his or her favorite products. This list should be maintained from a new account page to be created following Alan Storm his article:  http://alanstorm.com/magento_create_customer_page.

I have found this answer: https://stackoverflow.com/a/8426639 which (among others) shows how to add an attribute to a customer type.

What I would like to know is how I can add a product collection attribute type to a customer account.


texts: How i can use in href, customer edit url?

texts:
If i try this:

it'll return to the dashboard.


texts: Is any Payment Gateway exits for overseas customer pay as a dollar for my INR (INDIA) currency based websites

texts:
I need to get my payment from the overseas customer as a dollar value for my INR (india) currency based websites.

  My website Base Currency : INR :: Is any option exists overseas
  customer pay as a dollar, like INR : 100 payment gateway converted my
  INR to Dollar as $1.62, and customer pay as $1.62 with shipping price
  also.

Is Magento allowed overseas customer pay as dollar for indian website??????????


texts: magento 2 zipcode validation by select city and country in india only

texts: is it possible to select city state and country by validating zipcode in magento 2.I have jquery code for this. But i have no idea, how to integrate with code. any one guide me about this task?


texts: Check out Page Issue - reloading twice Magento 2.1.7

texts:
I Don't know why Commented code working in magento 2.1.7 I have used reload script for some reason but not required now. so i have commented that code. Even the Checkout page refreshing twice after clicking NEXT button.

If I remove that commented code page won't work. Kindly Help....
I am stuck on this As i am newbie.

            <img src="<?php /* @escapeNotVerified */ echo $block->getViewFileUrl('images/loader-1.gif'); ?>"
                 alt="<?php /* @escapeNotVerified */ echo __('Loading...'); ?>"
                 style="position: absolute;">


texts: Show admin order comments in sales order grid

texts: I am trying to show admin order comments in a new column I created in sales order grid. Anyone know how I would do this?


texts: Display lowest price in configurable products instead of zero

texts:
I have been looking for a solution for days now.

How do you display the lowest price of simples in a configurable product instead of zero on price.phtml page?

I got this issue resolved by using bundle product option, instead of configurable.  With bundle products, I can set a base default price from simples attached.


texts: The property $xxx is not a valid price specification in Magento2

texts:
"Also referring here for the issue: https://github.com/magento/magento2/issues/5022 - Microdata related issue for Magento 2 site"

  Price property is currently not well recognized in Google Structured
  Data testing tool.

What could be the temp yet effective solution to this issue?

thanks!


texts: getLastRealOrderId not working when payment done via payumoney

texts:
i did payment from payumoney .i have written custom module to notify after order done , below is snippet it work fine for cod but when payment done via payumoney i get error

$orderIncrementId = Mage::getSingleton('checkout/session')->getLastRealOrderId();
$orderObject = Mage::getModel('sales/order')->loadByIncrementId($orderIncrementId);
$orderObject->getBillingAddress()->getTelephone();

Error :

Fatal error: Call to a member function getTelephone() on boolean in /xxxt/Model/Observer.php


texts:
recently I've made www.einzigwebshop.nl using Magento and untill a few weeks ago it worked like a charm. However, now I can't seem to get my images working on front-end. They work just fine back-end!

I have CHMOD my media folder to 777
reindexing cache and store does not work
store view is correct
image, thumbnail and image_small are all set and NOT excluded
.HTaccess in /media/ is renamed
safe mode of PHP is OFF

It still does not work!

After searching for a solution for hours it doesn't seem to make my life any easier as all posted solutions are not working.

Help me out please, I'm desperate!


texts: Magento pricing with custom options to set new base price

texts:
I'm trying to find a solution for some complex pricing in Magento.

Example:

Product price is $200

first option is size. For example I choose size "large" which adds $50. The added value from the size option makes the new base price.
So $200 + $50 = $250 (this is the new base price)
Every next option price (percent or fixed) must be added to the new base price
Next option color, I choose "green" which adds 10%. So $250 + 10% of $250 = $275
Next option is material, I choose "leather" which adds another 10%. So $275 + 10% of $250 = $300.

Can anyone point me into the right direction?


texts: How to configure view for all categories in a step?

texts:
In categories --> single category --> view settings you can choose:

available product listing sort by
default product listing sort by

I need to change these 2 values for all categories in a single step avoiding to make it for every single categories by hand.

How to change these configuration settings?


texts: How do I enable free shipping in backend only (for order entry)

texts: How do I enable free shipping as shipping method when we create order from admin panel ?


texts:
essentially, I have a purchased a module to allow VAT Exemption, the user fills out a form as a step in the one page checkout.

The plugin is pretty basic and only contains a couple of fields, which I need more such as Charity Address and other information.

I dont want to overwrite the modules core files as this is bad practice, I am looking to extend it so that I can add additional fields to the save method.

Any pointers? I have been through a few tutorials on creating another module to extend the module's controller but for some reason no matter what I do I get no feedback at all.

All the tutorials I have seen all seem to extend the core controllers, which is pretty basic but doesn't seem to apply to my situation.

How do I go about this in Magento CE 1.9

Edit: Below is my current code for the my custom module that should overwrite another module, where is this going wrong?

etc/module/MyName_VatExemptExtended.xml

<?xml version="1.0"?>
    <config>
        <modules>
            <MyName_VatExemptExtended>
                <active>true</active>
                <codePool>local</codePool>
                <depends>
                    <Indies_Vatexempt/>
                </depends>
            </MyName_VatExemptExtended>
        </modules>
    </config>

local/MyName/VatExemptExtended/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <MyName_VatExemptExtended>
            <version>0.0.1</version>
        </MyName_VatExemptExtended>
    </modules>

    <frontend>
        <routers>
            <vatexempt>
                <args>
                    <use>standard</use>
                    <modules>
                        <MyName_VatExemptExtended before="Indies_Vatexempt_OnepageController">MyName_VatExemptExtended_OnepageController</MyName_VatExemptExtended>
                    </modules>
                </args>
            </vatexempt>
        </routers>
    </frontend>
</config>

local/MyName/VatExemptExtended/controllers/OnepageController.php

<?php

require_once Mage::getModuleDir('controllers','Indies_Vatexempt_OnepageController').DS.Adminhtml.DS.'OnepageController.php';

echo "DD";

class GiantPeach_VatExemptExtended_OnepageController extends Indies_Vatexempt_OnepageController

{
    public function __construct()
    {
        echo "__construct";
        die();
    }

    public function saveExemptAction()
    {
        echo "saveExemptAction";
        die();
    }
}

As you can see, at the moment I just want it to display something from my extended controller. I can see my custom module appearing in the Magento backend so it's loading the module ok, however, in my config if I force an error (by unclosing a tag or writing some rubbish outside of tags) I don't receive any visible syntax errors. Is my module being loaded correctly?

Thanks


texts: Magento 2.4.1 Developer Mode not working

texts:
i have installed Magento 2.4.1 via Docker and tried to change to developer mode. The problem is, that the developer option dont show up in the settings. I have tried:

Setting Developer Mode in nginx conf
Setting Developer Mode in .htaccess
Setting Developer Mode in the env.php
Change it in the console with bin/magento deploy:mode:set developer the result:
Enabled developer mode.

Any ideas why it does not work?
Thank you all


texts: how to speed up static content deploy for development

texts:
Especially after changing .html knockout js template files I have to always deploy static content with bin/magento setup:static-content:deploy <languages>.
This makes development very slow.
I can just delete all static contents and let it create on the fly but that is no alternative as it will raise page load times to 15+ seconds (sometimes more than a minute.)

How can I improve this situation?


texts: Magento 2 why area code is showing wrong?

texts:
we placed order from magento frontend checkout when we check area code from this -
$this->_checkState->getAreaCode()

then we are getting area code is "webapi_rest"
it must be frontend.


texts: home.reports.product.compared block in default home page never displays

texts:
I'm trying to use the layout XML that is set by default on the CMS Home page of a clean Magento install (See Admin > CMS > Pages > Design tab > Layout Update XML). It inserts three product blocks: new products, recently viewed products, and (I think) recently compared products.

All is well, except for the the recently compared block home.reports.product.compared which, despite my having compared some items (and they show up in the compare sidebar block), is never populated.

Am I misunderstanding the role of the block, or is it just plain broken?

Possibly related: the XML also unsets the sidebar blocks for recently viewed and compare, however the compare block still appears and in fact appears twice in the sidebar, only on the homepage.

<reference name="content">
<block type="catalog/product_new" name="home.catalog.product.new" alias="product_new" template="catalog/product/new.phtml" after="cms_page">
    <action method="setProductsCount"><count>8</count></action>
    <action method="addPriceBlockType"><type>bundle</type><block>bundle/catalog_product_price</block><template>bundle/catalog/product/price.phtml</template></action>
</block>
<block type="reports/product_viewed" name="home.reports.product.viewed" alias="product_viewed" template="reports/home_product_viewed.phtml" after="product_new">
    <action method="setProductsCount"><count>4</count></action>
    <action method="addPriceBlockType"><type>bundle</type><block>bundle/catalog_product_price</block><template>bundle/catalog/product/price.phtml</template></action>
</block>
<block type="reports/product_compared" name="home.reports.product.compared" template="reports/home_product_compared.phtml" after="product_viewed">
    <action method="addPriceBlockType"><type>bundle</type><block>bundle/catalog_product_price</block><template>bundle/catalog/product/price.phtml</template></action>
</block>
</reference>


texts: Magento add an postDispatch to a post action after submit form

texts:
I have this controller :

class Mage_Contacts_IndexController extends Mage_Core_Controller_Front_Action
{

    public function preDispatch()
    {
        parent::preDispatch();
        if( !Mage::getStoreConfigFlag(self::XML_PATH_ENABLED) ) {
            $this->norouteAction();
        }
    }

    public function indexAction()
    {
        $this->_initLayoutMessages('juron/ses');
        $this->renderLayout();
    }

    public function postAction()
    {
       $post = $this->getRequest()->getPost();
       if ( $post ) {
           ......
       }
    }
}

In the /Mage/Contacts/etc/config.yml :

    <events>
        <controller_action_postdispatch_contacts_index_post>
            <observers>
                <contacts>
                    <type>model</type>
                    <class>contacts/observer</class>
                    <method>postDispatch</method>
                <contacts>
            </observers>
        </controller_action_postdispatch_contacts_index_post>
    </events>

And in the /Mage/Contacts/Model/Observer.php :

class Mage_Contacts_Model_Observer
{
    public function postDispatch()
    {
        echo 'Stop';
        die();
    }
}

Normally when I try to submit the contact form I should see Stop and the execution should be finished but not work like this. Seems the observer is not called. Can you help me please ? Thx in advance. Any ideas please ?


texts:
in magento 1.x for price roud i used extension https://github.com/openstream/Magento5CentRounding
Does have somebody any solution for magento 2, or which functions i need rewrite ?
Is https://marketplace.magento.com/pits-module-five-cent-rounding.html a good option?


texts:
I'm very new to Magento and I'm trying to build a website for a company which sells tooling and equipment to the aerospace industry.

A site similar to ours handles this very well:

http://www.panamericantool.com/cobalt-drills/drill-stops.html
http://www.panamericantool.com/cobalt-drills/drill-stops.html

They both have different attributes and quantities, and the customer can choose a few and have them all added to the cart at once.

How would I go about recreating something like this? I assume it will be some form of configurable product?


texts: MYSQL 1452 error on product page. report_event_types table is empty

texts:
Upon opening a product page i get 404.

In exceptions log i see this error:

exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`fromae`.`report_event`, CONSTRAINT `FK_REPORT_EVENT_EVENT_TYPE_ID_REPORT_EVENT_TYPES_EVENT_TYPE_ID` FOREIGN KEY (`event_type_id`) REFERENCES `report_event_types` (`event_type_id`) ON DELETE C)' in /var/www/html/lib/Zend/Db/Statement/Pdo.php:228

I opened the database and saw that report_event_types tables is empty and this produces the exception. Should it be like this? Why is it empty? And how would i fix this?

UPD
I fixed it by adding necessary data into the report_event_types table.


texts: Google reCaptcha not working for inline login on Checkout page

texts:
I've installed msp-recaptcha-2.0.0.0 in my Magento 2.2.6 installation and all works fine except for a glitch on the Checkout page.

On the Checkout page customers first see the "Review & Payments" section which contains an "Email Address" field. The email field has a listener which checks whether an entered email address belongs to an existing customer. If yes, a hidden Password field is made visible and we see the text "You already have an account with us. Sign in or continue as guest." and a Login button. However the reCaptcha widget is NOT displayed. Thus it is impossible to log in from here as the error message "Incorrect reCaptcha" always results.

In the top right corner of the Checkout page there is a "Sign In" popup which DOES contain the reCaptcha widget and works properly.

The MSP reCaptcha extension includes code to use the reCaptcha widget in the in-line Login case, but it's not working. Any workaround or solution would be really appreciated. After many hours I still cannot make it work. Thanks.


texts:
I want to add a connection to our ERP database that uses MS-Server, but i can't figure out what I'm doing wrong.

I know how to connect to another MySQL DB, but for MSSQL?

config.xml

<resources>
    <erp_db>
        <connection>
            <host><![CDATA[1.2.3.4\somename]]></host>
            <username><![CDATA[user]></username>
            <password><![CDATA[password]]></password>
            <dbname><![CDATA[db_name]]></dbname>
            <!-- ??? -->
            <model>mssql</model>
            <type>pdo_mssql</type>
            <!-- ??? -->
            <active>1</active>
        </connection>
    </erp_db>
    <erp_write>
        <connection>
            <use>erp_db</use>
        </connection>
    </erp_write>
    <erp_read>
        <connection>
            <use>erp_db</use>
        </connection>
    </erp_read>
    <erp_setup>
        <connection>
            <use>core_setup</use>
        </connection>
    </erp_setup>
</resources>

If I try this to list all tables ...

$resource   = Mage::getSingleton('core/resource');
$connection = $resource->getConnection('erp_db');
$results    = $connection->fetchAll('SELECT * FROM sysobjects WHERE xtype="U"');
var_dump($results);

I get ...

  Fatal error: Class name must be a valid object or a string in /app/code/core/Mage/Core/Model/Resource.php on line 225

I also read Using MS SQL with Magento 1.9, some say it's not supported, but from comments it seems to be possible ...

The PDO adapter exists in Zend_Db_Adapter_Pdo_Mssql, but how to correctly use it?


texts:
In which table the attribute set ids are stored in magento 2.

I wish to save the product with its attribute set id . So Please provide me a solution


texts: Verify guest order and set guest order state

texts:
I'm trying to implement an order confirmation module for guest accounts. I researched now for a couple hours but it seems that I can't find any solution to my problem.

I need to verify if the email of a guest customer is actually valid. After the order is placed I observe the sales_order_place_after event and try to set the guest order to holded or a custom one like unconfirmed. Either way the state change gets overwritten by Magento.
After that I want to send an email with a verification link. And then change the state back to pending. I think I can overwrite the basic email template for a new guest order. Is this correct?

How can I set guest orders to a different state than the default "pending"?

Thank you all very much in advance!


texts: using direct sql query to update multiple rows at time in magento 2 is good practise or not

texts:
i have my custom module.i have to update multiple rows.if we follow the normal magento process i have to iterate through loop and update each at each time.so if there are large number of  rows to update then it takes very long time to iterate the loop

foreach($row as $row)
{
/*  $update=$this->companyFactory->create();
                    $update->load($divaid,"divauniqueid");
                    $update->setStatus($statusid);
                    $update->save();*/
}

so i want use direct update query instead of iterate loop.which is the good .please help with this


texts: How to Implement Look inside the Book Feature for Magento 1.9.3.9?

texts:
I want to develop a "Look Inside the Book" feature similar to what Amazon has.

Does anyone have a suggestion how I could achieve this?


texts: How to solve "Duplicate Of Template Name"?

texts: When I installed a new module and did the setup:upgrade I received this message:


texts: Some of the selected options are not currently available error in magento 1.9

texts:
I create one configurable product and create 5 Associative products for that configurable product and I create two custom options for one product. After,give values to options and I add that product to shopping cart and I got the following Error in cart page

I have used  following code to get custom options:

 if($option->getDefaultTitle()== "Measurement" && $input_type =="drop_down")      {
 echo '
';
 echo '<select id="drop" name="options['.$option->getId().']"   title="" ><option value="">select</option><option value="2" price="0">Feet </option><option value="1" price="0">Mtr </option></select>';
       echo '<input class="validate-one-required-by-name" type="'.$input_type.'" name="options['.$option->getId().']" value=""/>';
       echo '
';
}


texts: Get all associated value of a attributes in all products of category

texts:
i have category tree and product association like this

-> Parent category
  -> Sub Category1(Product1 and Product2 associated with this category)
  -> Sub Category2(Product3 and Product4 ''     ''   ''   ''   ''     )
  -> Sub Category3(Product4 and Product5 ''     ''   ''   ''   ''     )

And i have an attribute manufacturer with options brand A,brand B, brand C, brand D and brand E

The five products have attribute manufacturer values assigned to them.

Now, all i have is Parent category id (id=5) and i want to get which of the attribute values are associated with all the products under it ?

What i tried is this

<?php
    //with parent category id getting subcategories
    $category = Mage::getModel('catalog/category')->load(4);
            $subcategories = $category->getChildrenCategories();
            $subcategories->addAttributeToSelect(array('id','url'));
            $manufacturers = array();
            if (count($subcategories) > 0){
                foreach($subcategories as $subcategory){
                    array_push($subcatIds, $subcategory->getId());

                    $catagory_model = Mage::getModel('catalog/category')->load($subcategory->getId());
                    //getting all products collection to get attribute value
                    $collection = Mage::getResourceModel('catalog/product_collection');
                    $collection->addCategoryFilter($catagory_model);
                    $collection->addAttributeToFilter('status',1);
                    $collection->addAttributeToSelect(array('manufacturer'));
                    $collection->addStoreFilter();

                    //and finally getting unique attribute value
                    if(!empty($collection)){
                            foreach ($collection as $_product):
                                if(!in_array($_product->getAttributeText('manufacturer'), $manufacturers)){
                                    array_push($manufacturers, $_product->getAttributeText('manufacturer'));
                                }
                            endforeach;

                    }
                }
            }
            echo '<pre>'; print_r($manufacturers); echo '</pre>';
?>

I'm being able to get the result, but this is taking much time to load. As i'm getting this for megamenu.(In mega menu with categories, i want to present brands associated with the category) Is there any other options to do this ?

Drawback : This time i have only 65 products on those subcategories, and with the increase in number of products on those subcategories, the loading time will increase.


texts: How can i remove all referenceContainer in magento 2?

texts:
I want create new blank page and not use any block or container from magento2. I have used

<referenceContainer name="head" remove="true"/>
<referenceContainer name="header" remove="true"/>
<referenceContainer name="menu" remove="true"/>
<referenceContainer name="notifications" remove="true"/>
<referenceContainer name="footer" remove="true"/>
<referenceContainer name="body" remove="true"/>

but still remains a number of components.


texts:
I have the following block:

<?php
    //gets all sub categories of parent category 'Brands'
    $cats = Mage::getModel('catalog/category')->load(3)->getChildren();
    $catIds = explode(',',$cats);

    $categories = array();
    foreach($catIds as $catId) {
        $category = Mage::getModel('catalog/category')->load($catId);
        $categories[$category->getName()] = array(
            'url' => $category->getUrl(),
            'img' => $category->getImageUrl()
        );
    }
?>

        <?php foreach($categories as $name => $data): ?>

<a href="<?php echo $data['url']; ?>"><?php echo $name; ?>

                 <a href="<?php echo $data['url']; ?>"><img src="<?php echo $data['img']; ?>" />

        <?php endforeach; ?>

This produces a list of children categories for the given category but it is not sorted.

I have also tried the following code:

<?php
$cats = Mage::getModel('catalog/category')->load(3)->getChildrenCategories();
?>

<?php foreach($cats as $category): ?>

        <a href="<?php echo $category->getUrl() ?>"><?php echo $category->getName() ?>

<?php endforeach; ?>

This gets me a sorted list but without the possibility of thumbnails.

Any way to combine both solutions?
Thanks in advanced.


texts: Submit custom form using Popup modal in Magento 2

texts:
I have created a modal popup and I have added my custom fields inside that popup. Now, that popup and fields are coming and it's working fine. But the form is not showing inside that Popup. I want to sent that using Ajax to another controller to perform an action. Please help me how to do that.

Get Quote

    <form class="form" id="custom-form" method="post" autocomplete="off">
        <fieldset class="fieldset">
          <legend class="legend"><?php echo __('Personal Information') ?></legend>

               <?php echo __('Email') ?>

                    <input type="email" name="email" id="email_address" value="" title="<?php echo __('Email') ?>" class="input-text" data-validate="{required:true, 'validate-email':true}">

        </fieldset>

                <button type="submit" class="action submit primary" title="<?php  echo __('Submit') ?>"><?php echo __('Submit') ?></button>

    </form>


texts: Magento2 restrict cc number in the form fields

texts:
I would like to restrict CC number (Ex: 4111111111111111) in the customer form fields in the magento2 frontend.
Could you please advise me on how to do the step by step in Magento2.
Expected Results:

The approach I have followed:

app/code/Vendor/Module/view/frontend/requirejs-config.js

var config = {
    config: {
        mixins: {
            'Magento_Ui/js/lib/validation/validator': {
                'Vendor_Module/js/validator-mixin': true
            }
        }
    }
}

app/code/Vendor/Module/view/frontend/web/js/validator-mixin.js
define([
    'jquery'
], function ($) {
    "use strict";

    return function () {
        $.validator.addMethod(
            'validation16digit',
            function (v) {
            console.log("validation16digit has been calling");
                 v = v.replace(/-/g,""); v = v.replace(/ /g,"");  return !((/^\d+$/.test(v)) && ( (/([0-9]\d{12}(?:\d{3})?)/.test(v)) || (/(3[47]\d{13})/.test(v)) || (/(^(?:2131|1800|35\d{3})\d{11}$)/.test(v)) || (/((?:5020|5038|6304|6579|6761)\d{12}(?:\d\d)?)/.test(v)) || (/((?:6334|6767)\d{12}(?:\d\d)?\d?)/.test(v)) || (/(5[1-5]\d{14})/.test(v)) || (/(?:(?:(?:4903|4905|4911|4936|6333|6759)\d{12})|(?:(?:564182|633110)\d{10})(\d\d)?\d?)/.test(v))));

                return v;
            },
            $.mage.__('Please Enter Valid Input')
        );
    }
});

app/code/Vendor/Module/view/frotend/layout/default_head_blocks.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <script src="Vendor_Module::js/ccnumber1.js"/>
    </head>
</page>

app/code/Vendor/Module/view/frotend/web/js/ccnumber1.js
require(['jquery'],
function($) {
    "use strict";

    $(document).ready(function() {
    customValidations();
        function customValidations() {
            console.log("cc validatiaon calling");
            $('.input-text').each(function() {

                $(this).addClass("validation16digit");
            });
        }

    });
});


texts: Magento 2: After migration, Customer reindex is not working

texts:
This is the issue I face on indexing from terminal.

column 'created_in' used in key specification without a key length, query was: CREATE TABLE IF NOT EXISTS `customer_grid_flat`

Kindly help me to fix this.


texts: Magento 2 Translations not working on plugins

texts:
I have a translation file in
app/design/frontend/vendor/theme/i18n/en_US.csv
"sample_trans","Sample Trans"
my problem is when i try to call it in a plugin via __('sample_trans'). it doesnt work and it just return 'sample_trans'. its weird that this is working when you call __('sample_trans') in a controller.
does anyone has an idea why theme level translations are not working on plugins?


texts: Prevent my module controller accesing without user login

texts: How can i allow my controller to work only for logged in users? If non-loggedin user accesses my controller, he should be automatically redirected to login page and after successful login, he reaches my controller. Thanks for answers.


texts: magento2: how validation work in magento2

texts:
In magento1 we can check validation like this:

var formToValidate = $('form-validate');
    var validator = new Validation(formToValidate);
    if(validator.validate()) {
        // Here we can code after validation.
    }

but in magento2 i want to check all validation but don't want to submit form after success. so how can I perform with magento2 form?


texts: Create Category page which displays all Special Price products

texts:
Basically, I've created a category 'Products on Sale', which I would like to automatically contain all products in my catalog that have had a Special Price applied to them (via Catalog > Manage Products).  I would like the page to retain the layered navigation and sorting capabilities that a standard Magento Category page contains.

It seems like this is something that would be valuable to a majority of Magento users, and I'm surprised it is not included as part of the core functionality.

I've tried over a dozen Stack Exchange answers, blog posts, and forums, and nothing has worked thus far. Does anyone have a programmatic solution for this?

=== EDIT ===

Based on @pspahn's critique in the comments below, I've decided to pursue an alternate method of achieving similar functionality.  With that said, if you are interested in pursuing this line, @sander-mangel describes a method which seems entirely feasible.


texts:
Can someone please shortly describe how to set domains for my magento 2 different stores views and websites, or maybe recommend for me a good  tutorial,
thanks !


texts: "An error occurred during execution; please try again later."

texts:
I installed a module called FireGento MageSetup2, and then didn't need it anymore.

I then disabled it, uninstalled it then removed it from the composer.

However, when trying to load the Web Setup, spinning error occures due to a 500 error at /setup/index.php/componentGrid/components

This is the message shown:

Any ideas how I can fix this?

King regards


texts: catalog/products_list not working with different static blocks

texts:
I want to display category wise products on my homepage, for that i am using catalog/list via custom static blocks. Below is my code which i am pasting in my static block content.

{{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" category_id="3" template="catalog/product/list.phtml"}}

The problem is when i am pasting the same code in my another static block to display products from different category it is not working.

Please assist me what i am doing wrong.


texts:
How to join the below two collection for customer & Customer Address I want to use on grid

$entityType = Mage::getModel('eav/entity_type')->loadByCode('customer_address');
$customerAddressCollection = Mage::getModel('eav/entity_attribute')->getCollection()->setEntityTypeFilter($entityType);

and

$entityType = Mage::getModel('eav/entity_type')->loadByCode('customer');
$customerCollection = Mage::getModel('eav/entity_attribute')->getCollection()->setEntityTypeFilter($entityType);


texts: M2: Category Flat Data re-indexing never finishes?

texts:
So I know this used to be a common problem in M1.x. However, I only recently noticed this in our M2.1.3 environment.

How can I flush/wipe the Category flat data index and rebuild from scratch?


texts: Magento catalog product list soap API is not working

texts:
I'm trying to access magento product catalog data using magento API.

I'm trying sample code provided by magento

$client = new SoapClient('http://magentohost/api/soap/?wsdl');

// If somestuff requires api authentification,
// then get a session token
$session = $client->login('apiUser', 'apiKey');

$result = $client->call($session, 'catalog_product.list');
var_dump($result);

// If you don't need the session anymore
//$client->endSession($session);

All the API(s) are working fine expect the catalog product list.

I'm getting following error.

Fatal error: Uncaught SoapFault exception: [SOAP-ENV:Server] Call to a member function getRole() on null in G:\wamp64\www\mage-api\index.php on line 11
( ! ) SoapFault: Call to a member function getRole() on null in G:\wamp64\www\mage-api\index.php on line 11

I have created API user with full access role and it's working fine with all the API expect catalog list.

Any solution ?
Thanks in advance.


texts: How to create a main_category attribute for a product?

texts:
I want to create a second category assignment for my products which is limited to one category. The select should be similar to the default category assignment.

What I want is setting a main-category for each product which is used for tagging a product in diverse feeds.

I have absolutely no idea how to realize this and it would be great to get some help.


texts:
The issue is the following:
I have a huge amount of report files (+10000) and I need to analyze them.

Even on SSD I got problem using filemanager to group and divide them ( maybe is a problem with nautilus ) ...
filename is not very meaning full so it is difficult to remember a particular log file.

Any Idea ?


texts: Magento2 - Need to add 'next' button in checkout after billing & shipping address

texts: Need to add 'Next' button in the one step checkout after billing & shipping address


texts: Magento 2 different image size resolution per category

texts:
In the product view I have 1/2 ratio image for product A (material) and 3/4 ratio image for product B (material on person).
For the category view I can easily change the product picture ratio in the settings. For example to "Product Picture Ration = 3/4 Portrait. See here:

That does the job and my image is sharp without blur in category view.
Does anyone know how I can accomplish the same Picture Ratio also on product pages for images of this category? And only for this category?
Problem is, that the images uploaded and used as Thumbnail, Small and Base with Picture Ratio 3/4 Portrait get blurry in product view main view (strangely not when I click picture)
As per here:

Does anyone have an idea, how the image in product view remains sharp as per category settings "Product Picture Ration = 3/4 Portrait" where this is accomplished via the setting alone?
Regards


texts: How to implement Time Range Picker in Magento 2 Admin system.xml?

texts:
I found one similar solution that almost does what I want.
DateTimePicker System.xml

I have implemented its code and was able to display a DateTime Picker in my admin configuration. However, I would like to implement a Time Range Picker but I don't need a UI component way of implementing it.


texts: How would you import 22.000 products to Magento?

texts:
I'm working on a Magento store and I'm looking to import 22.000 products with a single solution.

I've written a Ruby wrapper for the REST API, it takes around 7 seconds to create a single product (visible in store, assigned to a product category, assigned to website and with one image)

The Ruby wrapper for the REST API is tested against a demo Magento store hosted on a DigitalOcean VPS with 2 CPU'S and 2GB RAM.

It would take a very long time to import the 22.000 with a single solution using the Ruby wrapper.

Since I'm not a very experienced programmer and don't have PHP or SQL knowledge, I'm wondering how a more experienced programmer would solve this.


texts: Magento 2 REST API - Update Payment Method

texts:
Is it possible to update payment method in Sales Order using Magento 2 API when Order is already created with a different payment method?
If it is, Can someone point to how this could be done?
Should something else be updated beside Order using REST API so a different payment method is selected when you open/check the order from the backend?

What I was trying is using different data for "POST /V1/orders/" to change a payment method. So, I was trying to change from "VISA" to "MASTERCARD".
Payment servise used is MPAY24.
Payment method codes are: mpay24cw_visa and mpay24cw_mastercard.

Thanks.

UPDATE:

I am trying to build an external approach to Magento API from a different CMS so I could create an order but in some cases when I create an order and then customer selects e.g. VISA credit cart but something is wrong with it and payment system returns an error the customer will try a different payment method. In that case I'm not sure If I can update payment method of already created order in Magento. Can I?


texts: aschroder SMTP Pro Extension SES not sending transactional emails

texts:
The self test email sends just fine using the SMTP Pro Extension configured with AWS SES, but no transactional emails will send. I've tested the welcome email, forgot password email, purchase confirmation email, and shipped email. In settings, under

system->configuration->SMTP Pro->Queue Configuration->Queue Usage

I've set it to never. I've also edited the file

app/code/core/Mage/Sales/Model/Order.php

on line 1356, replacing

$mailer->setQueue($emailQueue)->send();

with

$mailer->send();

To by pass the cron queue. I know its a bad idea to edit the core files, but I'm looking to fix the issue first, then I'll move the solution to its own local file. I have enabled both Log Emails and Debug Logging. Only the self-test email appears in the log, and the error log file under var/log/aschroder_smtppro.log is never generated. The apache user has write permissions for var/.

I'm at my wits end. Does anyone have any suggestions?


texts: How to disable zoom product image when click in magento 2

texts:
How to disable zoom product image when click in Magento 2.
I want disable zoom function.
I tryed change this code in view.xml but it not working.

My code change:

<var name="gallery">
        <var name="nav">thumbs</var> <!-- Gallery navigation style (false/thumbs/dots) -->
        <var name="loop">true</var> <!-- Gallery navigation loop (true/false) -->
        <var name="keyboard">true</var> <!-- Turn on/off keyboard arrows navigation (true/false) -->
        <var name="arrows">true</var> <!-- Turn on/off arrows on the sides preview (true/false) -->
        <var name="caption">false</var> <!-- Display alt text as image title (true/false) -->
        <var name="allowfullscreen">false</var> <!-- Turn on/off fullscreen (true/false) -->
        <var name="navdir">horizontal</var> <!-- Sliding direction of thumbnails (horizontal/vertical) -->
        <var name="navarrows">true</var> <!-- Turn on/off on the thumbs navigation sides arrows(true/false) -->
        <var name="navtype">slides</var> <!-- Sliding type of thumbnails (slides/thumbs) -->
        <var name="thumbmargin">20</var>
        <var name="thumbborderwidth">1</var>
        <var name="transition">
            <var name="effect">slide</var> <!-- Sets transition effect for slides changing (slide/crossfade/dissolve) -->
            <var name="duration">500</var> <!-- Sets transition duration in ms -->
        </var>
        <var name="fullscreen">
            <var name="nav">thumbs</var> <!-- Fullscreen navigation style (false/thumbs/dots) -->
            <var name="loop">true</var> <!-- Fullscreen navigation loop (true/false/null) -->
            <var name="arrows">true</var> <!-- Turn on/off arrows on the sides preview in fullscreen (true/false/null) -->
            <var name="caption">false</var> <!-- Display alt text as image title in fullscreen(true/false) -->
            <var name="navdir">horizontal</var> <!--Sliding direction of thumbnails in fullscreen(horizontal/vertical)  -->
            <var name="navarrows">false</var> <!-- Turn on/off on the thumbs navigation sides arrows(true/false) -->
            <var name="navtype">slides</var> <!-- Sliding type of thumbnails (slides/thumbs) -->
            <var name="transition">
                <var name="effect">slide</var> <!-- Sets transition effect for slides changing (slide/crossfade/dissolve) -->
                <var name="duration">500</var> <!-- Sets transition duration in ms -->
            </var>
        </var>
    </var>

    <var name="magnifier">
        <var name="fullscreenzoom">20</var>  <!-- Zoom for fullscreen (integer)-->
        <var name="top"></var> <!-- Top position of magnifier -->
        <var name="left"></var> <!-- Left position of magnifier -->
        <var name="width"></var> <!-- Width of magnifier block -->
        <var name="height"></var> <!-- Height of magnifier block -->
        <var name="eventType">hover</var> <!-- Action that atcivates zoom (hover/click) -->
        <var name="enabled">false</var> <!-- Turn on/off magnifier (true/false) -->
    </var>

Please help me fix it, thanks all.


texts:
On the homepage i have categories with description and 2 latest added products from that specific category.

Now i have it working to display 2 products per category with image and productname but i can't get it working to show the product price also.

This is my code now:

<?php
    $_categoryId = explode(' ', $category['id']);

    $count = 0;

    $_productCollection = Mage::getModel('catalog/category')->load($_categoryId)
        ->getProductCollection()
        ->addAttributeToSelect('*')
        ->setOrder('date_added', 'ASC');
    ?>

    <?php foreach ($_productCollection as $_product): ?>

        <?php
            $count++; // Note that first iteration is $count = 1 not 0 here.
            if($count <= 3) continue; // Skip the iteration unless 4th or above.
        ?>

            <a class="product-name" href="<?php echo $_product->getProductUrl() ?>">
                <?php echo $this->htmlEscape($_product->getName()) ?>

        <?php
            if($count == 6) break;
        ?>
    <?php endforeach ?>


texts:
I am a new in Magento. I have installed Magento 2.2. and created 1 module with custom page. There is 1 block on this page, which has to be shown on it. But it is not shown. Please, help me to resolve this problem. I will write code and structure of module below.

Structure

Block/Helloworld.php

<?php
namespace Inchoo\Helloworld\Block;

class Helloworld extends \Magento\Framework\View\Element\Template
{
public function getHelloWorldTxt()
{
    return 'Hello world!';
}
}

Controller/Index/Index.php

<?php

namespace Inchoo\Helloworld\Controller\Index;

use Magento\Framework\App\Action\Context;

class Index extends \Magento\Framework\App\Action\Action
{
protected $_resultPageFactory;

public function __construct(Context $context,     \Magento\Framework\View\Result\PageFactory $resultPageFactory)
{
    $this->_resultPageFactory = $resultPageFactory;
    parent::__construct($context);
}

public function execute()
{
    $resultPage = $this->_resultPageFactory->create();
    return $resultPage;
}

}

etc/routes.xml

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"     xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="standard">
        <route id="helloworld" frontName="helloworld">
            <module name="Inchoo_Helloworld" />
        </route>
    </router>
</config>

view/frontend/layout/helloworld_index_index.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd" layout="1column">

    <referenceContainer name="content">
        <block class="Inchoo\Helloworld\Block\Helloworld" name="helloworld" template="Inchoo_Helloworld::helloworld.phtml" />
    </referenceContainer>

view/frontend/templates/helloworld.phtml

<?php echo $this->getHelloWorldTxt(); ?>

When I open page http://localhost/magento/helloworld/index/index, page is shown, but block with H1 and "Hello World!" is not shown. Thanks for a help.


texts: How to set Block's template by calling a helper from layout XML?

texts:
I am trying to dynamically assign a template based on a condition. My helper works when called one way, but not another, which makes me believe I am using layout XML incorrectly.

To clarify, my helper is working correctly, but I am having trouble calling the helper in this case.

This works

Calling getOrderEmailItemsTemplate()

<block type="sales/order_email_items" name="items" template="email/order/items.phtml">
    <action method="addItemRender">
        <type>default</type>
        <block>sales/order_email_items_order_default</block>
        <template helper="Emailbygroup/Data/getOrderEmailItemsTemplate"></template>
    </action>
...

This doesn't work

Calling getOrderEmailTotalsTemplate()

...
<block type="core/template" name="order_totals_wrapper" as="order_totals" template="email/order/totals/wrapper.phtml">
    <block type="sales/order_totals" name="order_totals" helper="Emailbygroup/Data/getOrderEmailTotalsTemplate">
...

Helper

The helper just checks a condition and returns the template path based on that. I've added a log command to test if the Helper is even being loaded, but it isn't.

Mage::log("getOrderEmailTotalsTemplate is loaded... distributor ".$isDistributor,null,"tax.log");
if($isDistributor) {
    return 'sales/order/totals-discount.phtml';
} else {
    return 'sales/order/totals.phtml';
}


texts: upload file from adding a custom step on checkout onepage

texts:
I have created a new step after payment on checkout onepage and form in this step contains a file type element. I have to upload a file and save file using Ajax. I'm using the formData object in my js file to get the file details in $_FILES array in php but it's not working. Doing simply like this in my js file.

save: function () {
        //verifyStep = document.getElementById('verify-step').value;
        var formElement = document.getElementById("co-verify-form");
        var formData = new FormData(formElement);
        console.log(formElement);

        if (checkout.loadWaiting != false)
            return;
        if (this.validate()) {

            checkout.setLoadWaiting('verify');
            var request = new Ajax.Request(
                this.saveUrl,
                {
                    method: 'post',
                    onComplete: this.onComplete,
                    onSuccess: this.onSave,
                    onFailure: checkout.ajaxFailure.bind(checkout),
                    parameters: formData,
                }
            );
        }
    },


texts: Show Multiple Select Attribute in a CMS Block

texts:
I want to show Multiple Select Attributes in a CMS Block.
In the Block I used this code:

{{block type="core/template" name="ausgezeichnet" template="Magento_Theme/templates/html/auszeichnungen.phtml"}}

auszeichnungen.phtml looks like this

<?php
   $_prodID = Mage::registry('current_product')->getId();
   $_product = Mage::getModel('catalog/product')->load($_prodID );
?>

<?php echo $_product->getData('auszeichnungen') ?>
<?php
echo "Hello World";
?>

But nothing appears on the Product Page - neither "Hello World". The Block itself is showing, but just the headline, not the attributes values ...


texts: i want to get redorer url of order Id in magento , please help with you to do same , unable to find any soluiton to this issue.


texts: How many coupon codes I can create at a time in Magento?

texts:
I want to create 1 Million coupon codes.
What is the maximum no. of coupon codes I can generate at a time?
I tried to generate 0.2 Million coupons at a time but it displays error like

  maximum execution time reached

And I set unlimited execution time but no use.

Kindly help me.


texts: How to alter the position of block in sidebar

texts:
I want to change the position of block in my category pages. I tried in some xml file but couldn't get success.

Any idea would be appreciated.


texts: How to add css in custom module using layout file in Magento2?

texts:
I wan't to add bootstrap.css to a template in a custom layout.xml, this is my code:

view/frontend/web/css/bootstrap.css here is the css file

view/frontend/layout/pakke_trackshipment_info.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

  <head>
   <!-- Here I have tried both methods but no one worked -->
    <css src="Vendor_Pakke::css/bootstrap.css"/>
    <css src="css/bootstrap.css" />
  </head>

    <referenceContainer name="content">
        <block class="Vendor\Pakke\Block\TrackInfo\TrackingInfo" name="tracking_info" template="Vendor_Pakke::track_info.phtml"/>
        <!--Magento\Framework\View\Element\Template-->
    </referenceContainer>
</page>

Also I will add my controller code in case i'ts wrong. I'm practically sending $order_id to the template and printing the template.

public function execute()
{

   $order_id = $this->getRequest()->getParam("order_id");

    $resultPage = $this->resultPageFactory->create();
    $resultPage->getConfig()->getTitle()->prepend(__(' heading '));

    $block = $resultPage->getLayout()
            ->getBlock('tracking_info')
            ->setOrderId($order_id)
            ->toHtml();
    $this->getResponse()->setBody($block);
}

The template shows the html correctly with the data that I'm passing to it, but the css never loads, it's just plain html.

Greetings!


texts:
I have started to change over all my product URL from my old website to my new so we do not lose any google ratings, however i can't see any option to export category urls, only products or customers?

What i am trying to do is export a CSV which contain my categories and all of their URLs like you can do with the products, as i need to change the URLs to match our old website as we do not want to lose our google ratings. Then once I have changed them in the CSV file then i need to import the file again.

I have checked the export system in Magento but can only find a way of exporting customer or products.


texts: Magento 2 - Change primary button color by using .less files

texts:
I try to learn how to use .less by reading the official documentation. There is a very simple example which shows how we can change the color of a button from blue to orange.

So I created a fresh theme and added the file:

web/css/source/_theme.less

//  Primary button
@button-primary__color: @color-white;
@button-primary__hover__color: @color-white;
@button-primary__background: @color-orange-red1;
@button-primary__hover__background: @color-orange-red4;
@button-primary__border: 1px solid @color-orange-red2;
@button-primary__hover__border: 1px solid @color-orange-red2;

Then I refreshed the cache. But the button is still blue.
I selected the new theme in the backend of course.

I even deleted all folders in pub/static/frontend


texts: How can I get the website Id's a product is associated with?

texts:
I can set the website ids against a product by adding 'websites' => array(1,2) to an array and saving the product. The problem is this overwrites all websites so if I only want to add a product to a website (without touching the rest) then I need to know which websites the product is associated with.

I tried $product->getWebsites() but websites isn't in the _data var of the product object so returns null.


texts: Cannot get custom attribute from joined tables

texts:
$componentQuantityCollection = Mage::getModel('modules/modules')->getCollection();

$componentQuantityCollection->join(array('product' => 'catalog/product'), 'main_table.kit_sku = product.sku', '*', 'left');

foreach ($componentQuantityCollection as $kit) {
    Mage::log($kit->getKitOrderStock());
}

This returns null every time.  I'm sure these products have these attributes defined in the back end.  What am I doing wrong?

This generates the following sql:

  SELECT main_table.* , product.* FROM modules AS
  main_table  INNER JOIN catalog_product_entity AS product ON
  main_table.kit_sku = product.sku

The custom attribute is called 'kit_order_stock'.


texts: Programmatically logging in customer doesn't work

texts:
I'm using this code to login a customer programmatically:

<?php
require_once ("app/Mage.php");

Mage::app('default');

// Init a Magento session. This is super ultra important
Mage::getSingleton('core/session', array('name' => 'frontend'));

// $customer Mage_Customer_Model_Customer
// We get an instance of the customer model for the actual website
$customer = Mage::getModel('customer/customer')
    ->setWebsiteId(Mage::app()->getStore()->getWebsiteId());

// Load the client with the appropriate email
$email = "user@email.com";
$customer->loadByEmail($email);

// Get a customer session
$session = Mage::getSingleton('customer/session');

// Login an check the customer by his database userId
if ($session->loginById($customer->getId())) {
    echo '
Succesfull loginById
';
} else {
    echo '
Error in loginById
';
}

if ($session->isLoggedIn()) {
    echo '
Welcome
';
} else {
    echo '
Denied
';
}

But it's not working, the result I'm getting in the browser is:

  Succesfull loginById

  Denied

What could be the issue here?

EDIT

Some new information: I've tried this script on a different shop we have running and it works perfectly there. Why would it work on one but not the other?

EDIT 2

More troubleshooting has resulted in the conclusion that $session->getId() returns NULL while it should return an actual ID. Still no idea why this shop doesn't return a session id while the other one does.