texts: Custom header link not showing in magento 2

texts:
I am trying to add custom header link, but it is not showing. For this I am written below code.

Block

<?php

namespace Test\FLinks\Block;

class Header extends \Magento\Framework\View\Element\Html\Link{

    protected $_template = 'Test_FLink::link.phtml';

    public function getHref()
    {
        return __( 'testuser');
    }

    public function getLabel()
    {
        return __('Test Link');
    }

}

layout tried both files default.xml/header.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">

        <referenceBlock name="header.links">
            <move element="test-link" destination="header.links"/>
            <block class="Test\FLinks\Block\Header" name="test-link" after="my-account-link"/>
        </referenceBlock>

</page>

templates

<?php /** @var  \Test\Flinks\Block\Header $block */ ?>

    <a <?php echo $block->getLinkAttributes() ?>><?php echo $block->escapeHtml($block->getLabel())?>
        <?php /*echo($block->getCounter()) ? '' . $block->escapeHtml($block->getCounter()) . '' : ''; */?>

Welcome to Magento 2

Magento 2


texts: Is there any Payment Gateway that support Alipay and WeChat pay in a single integration in Magento2?

texts:
I'm not sure whether this question can be asked here but I don't see any other options. So please excuse me.
I've been searching for quite sometime to find a suitable Payment gateway that supports both Alipay and WeChat pay in a singe integration in Magento2. So far I couldn't find any. So it would of great help if I could have some expert suggestions regarding the same. Please suggest suitable modules.


texts: PHP Fatal error: Call to a member function setCustomerId() on a non-object in . /app/code/core/Mage/Customer/controllers/AccountController.php

texts:
This occurs when a customer clicks the forgotten password link on the
  front end; they are sent an email with a link to click and when they
  click the link in the email, a blank white page is shown in the
  browser or an internal server error such as the following:

  Server error The website encountered an error while retrieving
  https://www.example.co.nz/customer/account/resetpassword/?id=1271&token=b0e401762edadb425d4cdf65dd412bf9.
  It may be down for maintenance or configured incorrectly. Here are
  some suggestions: Reload this web page later. HTTP Error 500 (Internal
  Server Error): An unexpected condition was encountered while the
  server was attempting to fulfill the request.


texts: Magento 2: Check the attribute is in specific group or not

texts:
Hi i am trying to get the attributes of product from specific group.  I am using following code.

$pattr = $product_coll->getAttributeSetId();
$group_id = $block->getAttributeGroupId($pattr);
$attrCodes = $block->getProductAttrData($pattr);
foreach($attrCodes as $attrCode)
{
    echo $attrCode->getDefaultFrontendLabel().'<br>';
    if ($attrCode->isInGroup($pattr, $group_id))
    {
        echo 'In Product details';
    }
 }

I write this code in my phtml template. But this is not working. Please help me to solve this.


texts:
In the Magento 1.9 in which file takes the weight calculation for shipping?
I'm used the table rates mehod to shipping


texts: Magento 2 - Create UPS shipping label for order with offline shipping option

texts:
Problem

I have a client who uses fixed table rates to calculate shipping prices on his website. Behind the scenes, he ships all of his orders through UPS. He would like to automate creating shipping labels through the website, but Magento 2 only allows shipping labels to be created if the order itself is associated with UPS (or another shipping provider). So it won't allow "offline" shipping providers to use shipping labels for "online" providers.

Related Links

https://github.com/magento/magento2/issues/3899

https://www.mageplaza.com/kb/how-to-create-shipping-labels-magento-2.html

Question

Is it possible to enable UPS shipping labels for orders using fixed table rates to calculate the shipping price?

Existing plugins would be ideal. If not available, I'm looking for guidance to implement it myself.


texts: How to display default attribute filter on homepage / any page

texts:
I am looking for a way to  display the default attribute filter on the homepage / any page.
I tried all kinds of settings in the backend (Category Manager and Attribute Manager), but the attribute filter never shows up on the home page. It neither shows up when the category is empty.

Could I do this with a Custom Layout Update in the "Category Manager" and/or the "CMS Manage Pages"?  Do I need to make changes in the local.xml?

Or is this only possible when I change the Homepage into a Category Page?

Regards,
Els


texts: From where payment html coming in order related email?

texts:
From where payment html coming inn order related template?

Code for payment HTML:

{{var payment_html|raw}}

I already checked

  /vendor/magento/module-payment/view/frontend/templates/info/default.phtml

file but it is calling for the admin order only. It it not calling for the front end orders.


texts: Integrating Elastic search in Magento EE 2.1.2

texts:
I want to integrate Elastic search in Magento EE 2.1.2. I have installed elastic search instance and did configuration in Magento Admin. When I click on TEST CONNECTION button in Admin it says Successful! Test Again?

I want to know how Elasticsearch processes the search request. I want to check the search query on elascticsearch server.

When I hit my elastic search from browser I get this result:

name    "My First Node"
cluster_name    "mycluster1"
version
number  "2.3.1"
build_hash  "bd980929010aef404e7cb0843e61d0665269fc39"
build_timestamp "2016-04-04T12:25:05Z"
build_snapshot  false
lucene_version  "5.5.0"
tagline "You Know, for Search"


texts:
In Magento 2.2

My Magento cron job is as follows

* * * * */opt/alt/php71/usr/bin/php /home/XXX/public_html/bin/magento cron:run 2>&1 | grep -v Ran jobs by schedule

Due to this cron, so many email came. In 1 minute,  3-5 emails.

about the mail :

grep: jobs: No such file or directory
grep: by: No such file or directory
grep: schedule: No such file or directory

Anyone know what happened?

Please assist. Thank you


texts: Product Import with Image Links on another website

texts:
I have a Product list with over 16,000 items in it. I followed the System>import> and successfully uploaded all 16000 items. For the images however, I have link to my distributors website for example, image_small> http://cdn.distributorsname.com/images/1x1/small/a/a/image1.jpg

Now, the images are not showing for any of the products. If it was just 1 or two products I could have uploaded the images manually, for 16,000 its difficult. So, please help me the soonest you can. Thank you.


texts: Fatal error: Call to a member function setCustomerId() on boolean in /app/code/Ced/CsMarketplace/Controller/Account/CreatePassword.php:78

texts:
This occurs when a Vendor clicks the forgotten password link on the front end; they are sent an email with a link to click and when they click the link in the email a page open with this error.
<?php

namespace Ced\CsMarketplace\Controller\Account;

use Ced\CsMarketplace\Model\AccountManagement;
use Magento\Customer\Model\Session;
use Magento\Framework\View\Result\PageFactory;
use Magento\Framework\App\Action\Context;

class CreatePassword extends \Magento\Customer\Controller\AbstractAccount
{
/**
 * @var \Magento\Customer\Api\AccountManagementInterface
 */
protected $accountManagement;

/**
 * @var Session
 */
protected $session;

/**
 * @var PageFactory
 */
protected $resultPageFactory;

/**
 * @param Context $context
 * @param Session $customerSession
 * @param PageFactory $resultPageFactory
 * @param AccountManagementInterface $accountManagement
 */
public function __construct(
    Context $context,
    Session $customerSession,
    PageFactory $resultPageFactory,
    AccountManagement $accountManagement
) {
     $registry = \Magento\Framework\App\ObjectManager::getInstance()->get('Magento\Framework\Registry');

    $this->session = $customerSession;
    $this->resultPageFactory = $resultPageFactory;
    $this->accountManagement = $accountManagement;
    if(!$registry->registry('vendorPanel'))
        $registry->register('vendorPanel', 1);
    parent::__construct($context);
}

/**
 * Resetting password handler
 *
 * @return \Magento\Framework\Controller\Result\Redirect|\Magento\Framework\View\Result\Page
 */
public function execute()
{
    $resetPasswordToken = (string)$this->getRequest()->getParam('token');
    $customerId = (int)$this->getRequest()->getParam('id');
    $isDirectLink = $resetPasswordToken != '' && $customerId != 0;
    if (!$isDirectLink) {
        $resetPasswordToken = (string)$this->session->getRpToken();
        $customerId = (int)$this->session->getRpCustomerId();
    }

    try {
        $this->accountManagement->validateResetPasswordLinkToken($customerId, $resetPasswordToken);
        if ($isDirectLink) {

            $this->session->setRpToken($resetPasswordToken);
            $this->session->setRpCustomerId($customerId);
            $resultRedirect = $this->resultRedirectFactory->create();
            $resultRedirect->setPath('*/*/createpassword');
            return $resultRedirect;
        } else {

            /** @var \Magento\Framework\View\Result\Page $resultPage */
            $resultPage = $this->resultPageFactory->create();
            $resultPage->getLayout()->getBlock('vendor.resetPassword')->setCustomerId($customerId)
                ->setResetPasswordLinkToken($resetPasswordToken);
            return $resultPage;
        }
    } catch (\Exception $exception) {
        $this->messageManager->addError(__('Your password reset link has expired.'));
        /** @var \Magento\Framework\Controller\Result\Redirect $resultRedirect */
        $resultRedirect = $this->resultRedirectFactory->create();
        $resultRedirect->setPath('*/*/forgotpassword');
        return $resultRedirect;
    }
}
}


texts: Magento 2: New order mail notification to admin

texts:
In my store New order mail notification successfully sending to customers but not sending to admin.

I know this method can help to send a BCC to entered emails

  Store->Configuration->Sales->Sales Emails->Send Order Email Copy To

But in this case, email contents only matches to customers not for admins.


texts: Recreating or cloning Adminthml_System_Config blocks and functionality in a custom module

texts:
I am writing a custom admin module, which is supposed to display chosen tabs / content blocks from System > Admin > Config (as they are there).

I was initially hoping to be able to do this via layout.xml or block/model class-group calls from within my module, but after reviewing Mage/Adminhtml, I am not so sure, this is the right call.

Naturally, repeating the blocks/functionality of Mage::(Adminhtml/Config) is an option, but I am wondering if there is any less-cumbersome way do this ?


texts:
I was uploading localhost site to live server. During the process I was importing .sql file from localhost to PHPMyAdmin live server database. After the uploading process was complete I got an error of:

SQL query:

ALTER TABLE `core_email_queue_recipients`
ADD CONSTRAINT `FK_6F4948F3ABF97DE12127EF14B140802A`
FOREIGN KEY (`message_id`) REFERENCES `core_email_queue` (`message_id`)
ON DELETE CASCADE ON UPDATE CASCADE

MySQL said:

  #1452 - Cannot add or update a child row: a foreign key constraint fails (`buddydea_magento`.`#sql-2aae_84a13f`, CONSTRAINT
  `FK_6F4948F3ABF97DE12127EF14B140802A` FOREIGN KEY (`message_id`)
  REFERENCES `core_email_queue` (`message_id`) ON DELETE CASCADE ON
  UPDATE CASC)

I have looked for the solution but didn't find the right answer.

Please help me to remove this error.


texts:
How to save attribute value into DB from a phtml ?

ie, Phtml contains a custom input field which is rendered in the admin product edit page under a custom tab.

The value entered in the input field should be saved in an attribute which already created by admin


texts: Listing products created at specific date in Magento SOAP API

texts:
I need to list the products based on created date, How to filter the list based on created at in the following code

$client = new SoapClient('http://magentohost/api/v2_soap/?wsdl');
$session = $client->login('apiUser', 'apiKey');
$complexFilter = array(
'complex_filter' => array(
    array(
        'key' => 'type',
        'value' => array('key' => 'in', 'value' => 'simple,configurable')
    )
)
);
$result = $client->catalogProductList($session, $complexFilter);
var_dump ($result);

key as created at and value as some date. How to achieve this...


texts: Removing Links from Header Links - Magento 2

texts:
Sorry if it's in the wrong category and I'm just asking for help. I'm not a developer but I've changed dabbled in Magento 1 coding mainly just removing stuff or moving it.

I'm confused how it works in Magento 2. Right clicking in Developer tools on Chrome, shows the links are sitting in header links. For the life of me, I can't find this.

I have even tried looking under default.xml under the theme I have bought and this is the only code in the file.

<referenceContainer name="header-wrapper-container">
<container name="header.wrapper.container.top" htmlTag="div" htmlClass="header-wrapper-container-top" before="-">
<container name="header.area.1" htmlTag="div" label="Header Area 01" htmlClass="header-area-01 hidden-xs" before="-" />

</container>

<container name="header.wrapper.container.bottom" htmlTag="div" htmlClass="header-wrapper-container-bottom" after="header.wrapper.container.top">
<block class="Magento\Theme\Block\Html\Header\Logo" name="smalllogo" template="html/header/smalllogo.phtml" before="-" />

</container>
</referenceContainer>

<move element="logo" destination="header.wrapper.container.top" after="header.area.1" />
<move element="navigation.sections" destination="header.wrapper.container.bottom" after="smalllogo" />

<referenceBlock name="footer_links" display="true" />

<move element="footer_links" destination="footer" after="copyright" />
</body>
</page>

I have two Links I want to remove (Wishlist and Compare as seen here - www.peakaboo.co.uk. I also want to move the Cart into the navigation like http://newsmartwave.net/magento/vigoshop/index.php/?___store=demo2_default.

I've checked through most folders and found other other phtml files but nothing about header links, or top.links. (I've also tried that top.links).

I hope someone can help me.

Regards,


texts: Is there any search option which lets you search for which products are not showing on one of your websites?

texts: I am working with a company that is selling products in several different countries. Right now I am making sure that all products that are for sale in country 1 also appears on the web page for country 2. The problem is that there is a big backlog, so I am sitting and scanning through page after page in backend trying to find stock that is only on one website. Is there any search option which will let me search for products that ISN'T on a particular site? That way I could speed up the process a lot.


texts: How To Set Product URL Key OR Redirect URL in PHP

texts:
So I am creating a Magento product when I call this if statement and it returns false, that all works...

I just want to create the URL or create a URL redirect for the product in the same statement

It needs to be within the same if statement as I want it to be created at the same time of the product creation

Here is my code:

if (!Mage::getModel('catalog/product')->getIdBySku($sku))  {

  $product = Mage::getModel('catalog/product');
  $product->setName($name);
  $product->setSku($sku);
  $product->setDescription($desc);
  $product->setShortDescription($short);

  $stock_data=array(
    'use_config_manage_stock' => 0,
    'qty' => 0,
    'min_qty' => 0,
    'use_config_min_qty'=>0,
    'min_sale_qty' => 1,
    'use_config_min_sale_qty'=>1,
    'max_sale_qty' => 9999,
    'use_config_max_sale_qty'=>1,
    'is_qty_decimal' => 0,
    'backorders' => 0,
    'notify_stock_qty' => 0,
    'is_in_stock' => 0
  );

  $product->setData('stock_data',$stock_data);
  $product->setTaxClassId(2);     // default tax class
  $product->setAttributeSetId(4); //9 is for default

  $product->setWebsiteIds(array(1));
  $product->setCategoryIds(array(9));
  $product->setStatus(1);//1=Enabled; 2=Disabled;
  $product->setVisibility(4);//4 = catalog &amp; search.

  try
  {
    $product->save();
  } catch(Exception $e) {
    echo $e->getMessage();
  }
}


texts:
I'm trying to add custom field in my products, "bra_size".

I'm able to add it in magento, make associated_item with it, but impossible to get the value of this product in the associated_products array of the products.

When I make a "http://magento.xxx.com/api/catalog/get_product.php?productId=xx" on the configurable product, I get this :

configitems: {
Bra Size: {
79: "95 D",
80: "95 C",
83: "90 D",
84: "90 C",
88: "85 D",
89: "85 C"
}

But in the associated_products array, "brasize" don't appear :

{
product_id: "1259",
type_id: "simple",
inventory: "0.0000",
sku: "TRD01-92173-85 C",
weight: "0.1500",
news_from_date: null,
news_to_date: null,
status: "1",
visibility: "4",
created_at: "2014-06-17 11:27:39",
updated_at: "2014-06-17 11:28:02",
custom_smartid: null,
custom_color: null,
custom_pantsize: null,
custom_shoesize: null,
custom_shirtsize: null,
custom_uniquesize: null,
price: 17.95
},

I also kmow that magento save the value of braSize in the simple product, but still don't able to catch it from the configurable product.
Does anyone know how to fix it ?
Thank's a lot ;)

EDIT :
Yep, I rebuild all indexes, reboot server, but just use Magento to add attribute (no php or module or other)
Here is the get_product.php :

require_once dirname(__FILE__).'/../app/Init.php';

$task = new Init(__FILE__);

try {
    $client = $task->getSOAPClient();
    $session = $task->getSOAPSession($client);

    $productId = $_GET['productId'];

    $result[0] = array('catalog_product.information', $productId);
    $result[1] = array('catalog_product_attribute_media.list', $productId);

    $list = $client->multiCall($session, $result);

    $task->setResponse($list);
} catch(Exception $e) {
    $task->errorResponse($e->getMessage());
}


texts:
Hello I have used ves and varnish full page cache extensions for better speed performance

but it is creating some issues now like my cart page is not showing all newly added product or showing old/wrong prices etc.

So I want to know why is this happening and did I miss some configuration for VES module or I should disable it as it is creating an issue.

Also, I want to mention I have All three caches enabled Magento default FPC, Varnish FPC and VES FPC.

Is it causing an issue?

Thanks


texts: which is the compatible xampp version of this magento Magento-CE-2.3.1

texts: which is the compatible xampp version of this magento version Magento-CE-2.3.1-2019-03-18-06-24-49 (1)


texts: Customer Repository Interface, Limit Results

texts:
I'm trying to grab the oldest customer, using the customer repository from the database.

Here's my code so far:

    // if custom is active
    $isActivefilter = $this->filter
        ->setField('is_active')
        ->setConditionType('eq')
        ->setValue(1)
        ->create();

    $isActiveFilterGroup = $this->filterGroup
        ->addFilter($isActivefilter)
        ->create();

    // ========== AND ========== //

    // if customer has an account id = $user
    $accountIdFilter = $this->filter
        ->setField('account_id')
        ->setConditionType('eq')
        ->setValue($user)
        ->create();

    $accountIdFilterGroup = $this->filterGroup
        ->addFilter($accountIdFilter)
        ->create();

    // ========== SORT BY CREATED AT ========== //

    // setting the sort order to ascending will bring the oldest records to the top
    $sortByCreatedAt = $this->sortOrder
        ->setAscendingDirection()
        ->create();

    $searchCriteria = $this->searchCriteria
        ->setFilterGroups([$isActiveFilterGroup, $accountIdFilterGroup])
        ->setSortOrders([$sortByCreatedAt]);

So before I set the search criteria in getList($searchCriteria), I want to make sure I'm only querying for one result like  limit 1

Is there a way to do that using the repository and search criteria?


texts: How to apply tax on order which is programmatically created in magento

texts:
I am creating an order programmatically in magento but tax is not applied on it. How can i apply tax on order based on address in my script only??

Any help would be appreciated.


texts: Do I need to apply USPS Patch (SUPEE-7616)?

texts:
On January 17, 2016, USPS made several changes to their services,
  rates, and package names. The updates are reflected in this release,
  and include the following changes:

  Standard Post renamed “Retail Ground” Flat Rate Box for Priority Mail
  Express Eliminated Because the USPS changes are not included in the
  security patch, earlier versions of Magento must be updated by
  installing the SUPEE-7616 patch. The patch is available for download
  in the same location as the security patch bundle.

I haven't enabled USPS from my admin. I was wondering if I need to install this patch.

Reason I am asking this is because I haven't installed earlier version of patches of USPS. To install this patch I will have to install them all.


texts: Can we block some cities or towns in Magento?

texts: I want to ship only certain towns and cities my products in magento. I'd prefer dropdown cities and towns instead of inputboxes in frontend... Is there any extensions, codes or settings in magento for that?


texts: How to format price based on currency code

texts:
How can I change format a price with giving some specific currency code?

I search it on google but only thing which I find is to format price based on selected currency.

But I want to format that price with a specific currency.

Is there is any way to do that??

Any help will be appreciated.


texts: How to check if configurable options have been chosen before showing a modal?

texts:
I have added a new button next to the add-to-cart button:
<button type="button" class="action secondary personalize" data-trigger="personalise">

</button>

The idea being, when you click on the button you can personalise further the config'd product. At the moment it is possible to get into this personalization journey without selecting the necessary product options (e.g. size and colour).
Here is my snippet from my frontend/web/js/personalise.js file:
        initializeModal: function (element) {
            let options = {
                type: 'popup', // popup or slide
                responsive: true, // true = on smaller screens the modal slides in from the right
                title: 'you are personalising : '+ this.product,
                trigger: '[data-trigger=personalise]'
            };
            //How to check if options have been selected?
            if(true) {
                //all options selected, show modal
                this.modal = modal(options, $(element));
            }
            else {
                //not all options selected, show error message.
            }
        },

How do I trigger the validation that's linked to the add to cart button (id="product-addtocart-button") without actually adding to cart when a user clicks on my personalisation button?? Basically I want to make sure that all required options are selected and, if not, show a message saying "This is a required field.". If all options are selected, then allow the modal to show.


texts: Magento 2 post params don't have the image file

texts:
I'm developing an admin grid list. In the edit form i have an image field, but when i save it it does't appear in:

$data = $this->getRequest()->getPostValue();

and in:

$data = $this->getRequest();

I can see:

  protected 'postParams' =>
    object(Zend\Stdlib\Parameters)[73]
      private 'storage' (ArrayObject) =>
        array (size=9)
          'form_key' => string 'gSliqxNCIitA25WV' (length=16)
          'entity_id' => string '9' (length=1)
          'name' => string 'bla' (length=3)
          'surname' => string 'bla' (length=3)
          'email' => string 'bla' (length=3)
          'company' => string 'bla' (length=3)
          'note' => string 'bla' (length=3)
          'store_id' => string '1' (length=1)
          'url_key' => string 'bla' (length=3)
  protected 'fileParams' =>
    object(Zend\Stdlib\Parameters)[74]
      private 'storage' (ArrayObject) =>
        array (size=1)
          'image' =>
            array (size=5)
              ...
  protected 'version' => string '1.1' (length=3)
  protected 'headers' =>
    object(Zend\Http\Headers)[75]
      protected 'pluginClassLoader' =>
        object(Zend\Http\HeaderLoader)[78]
          protected 'plugins' =>
            array (size=55)
              ...

And maybe i can get the image from the 'fileParams', but i don't know how.
I already tried:
 var_dump($this->getRequest()->getParams());

so, any idea?


texts: Magento 2.1 Uncaught TypeError: Cannot read property 'replace' of null

texts:
Hi whenever I try to create a new product I get the following error in the console:

Uncaught TypeError: Cannot read property 'replace' of null

This is the only time I get this, I can create pages, blocks etc. But not the products. It looks like It doesn't generate the static-content correctly for some reason.

I'm running my installation on Forge with nginx, php7.0 and mysql5.7.12-0ubuntu1.1 and Ubuntu 16.04.

The full error log is:

import-handler.js:140 Uncaught TypeError: Cannot read property 'replace' of nullupdateValue @ import-handler.js:140handleNameChanges @ import-handler.js:37setNested @ objects.js:43nested @ objects.js:117set @ element.js:301updateValue @ links.js:57setLink @ links.js:144(anonymous function) @ links.js:165_resolveRequest @ registry.js:413_addRequest @ registry.js:380get @ registry.js:224transfer @ links.js:162setLinks @ links.js:205initLinks @ element.js:182initialize @ element.js:103(anonymous function) @ wrapper.js:109_super @ wrapper.js:106initialize @ abstract.js:69(anonymous function) @ wrapper.js:109UiClass @ class.js:49initComponent @ layout.js:66fire @ jquery.js:3099fireWith @ jquery.js:3211deferred.(anonymous function) @ jquery.js:3301fire @ jquery.js:3099fireWith @ jquery.js:3211deferred.(anonymous function) @ jquery.js:3301(anonymous function) @ layout.js:59execCb @ 4cdbbd4….js:1650context.execCb @ resolver.js:131check @ 4cdbbd4….js:866(anonymous function) @ 4cdbbd4….js:1113(anonymous function) @ 4cdbbd4….js:132(anonymous function) @ 4cdbbd4….js:1156each @ 4cdbbd4….js:57emit @ 4cdbbd4….js:1155check @ 4cdbbd4….js:917(anonymous function) @ 4cdbbd4….js:1113(anonymous function) @ 4cdbbd4….js:132(anonymous function) @ 4cdbbd4….js:1156each @ 4cdbbd4….js:57emit @ 4cdbbd4….js:1155check @ 4cdbbd4….js:917(anonymous function) @ 4cdbbd4….js:1113(anonymous function) @ 4cdbbd4….js:132(anonymous function) @ 4cdbbd4….js:1156each @ 4cdbbd4….js:57emit @ 4cdbbd4….js:1155check @ 4cdbbd4….js:917enable @ 4cdbbd4….js:1143init @ 4cdbbd4….js:774(anonymous function) @ 4cdbbd4….js:991(anonymous function) @ 4cdbbd4….js:132(anonymous function) @ 4cdbbd4….js:2173execCb @ 4cdbbd4….js:1650context.execCb @ resolver.js:131check @ 4cdbbd4….js:866(anonymous function) @ 4cdbbd4….js:1113(anonymous function) @ 4cdbbd4….js:132(anonymous function) @ 4cdbbd4….js:1156each @ 4cdbbd4….js:57emit @ 4cdbbd4….js:1155check @ 4cdbbd4….js:917(anonymous function) @ 4cdbbd4….js:1113(anonymous function) @ 4cdbbd4….js:132(anonymous function) @ 4cdbbd4….js:1156each @ 4cdbbd4….js:57emit @ 4cdbbd4….js:1155check @ 4cdbbd4….js:917(anonymous function) @ 4cdbbd4….js:1113(anonymous function) @ 4cdbbd4….js:132(anonymous function) @ 4cdbbd4….js:1156each @ 4cdbbd4….js:57emit @ 4cdbbd4….js:1155check @ 4cdbbd4….js:917enable @ 4cdbbd4….js:1143init @ 4cdbbd4….js:774(anonymous function) @ 4cdbbd4….js:991(anonymous function) @ 4cdbbd4….js:132(anonymous function) @ 4cdbbd4….js:2173execCb @ 4cdbbd4….js:1650context.execCb @ resolver.js:131check @ 4cdbbd4….js:866(anonymous function) @ 4cdbbd4….js:1113(anonymous function) @ 4cdbbd4….js:132(anonymous function) @ 4cdbbd4….js:1156each @ 4cdbbd4….js:57emit @ 4cdbbd4….js:1155check @ 4cdbbd4….js:917(anonymous function) @ 4cdbbd4….js:1113(anonymous function) @ 4cdbbd4….js:132(anonymous function) @ 4cdbbd4….js:1156each @ 4cdbbd4….js:57emit @ 4cdbbd4….js:1155check @ 4cdbbd4….js:917enable @ 4cdbbd4….js:1143init @ 4cdbbd4….js:774(anonymous function) @ 4cdbbd4….js:991(anonymous function) @ 4cdbbd4….js:132(anonymous function) @ 4cdbbd4….js:2173execCb @ 4cdbbd4….js:1650context.execCb @ resolver.js:131check @ 4cdbbd4….js:866(anonymous function) @ 4cdbbd4….js:1113(anonymous function) @ 4cdbbd4….js:132(anonymous function) @ 4cdbbd4….js:1156each @ 4cdbbd4….js:57emit @ 4cdbbd4….js:1155check @ 4cdbbd4….js:917enable @ 4cdbbd4….js:1143init @ 4cdbbd4….js:774callGetModule @ 4cdbbd4….js:1170completeLoad @ 4cdbbd4….js:1544onScriptLoad @ 4cdbbd4….js:1671


texts: Remove block using unsetChild in Magento1

texts:
I have an observer which this event: core_block_abstract_to_html_before. This is the code from my method:

$_block = $event->getBlock();
$_type = $_block->getType();
if ($_type == 'catalog/product_view'){
   $_block->unsetChild('product.info.container1');
}

This is the xml:

<block type="core/template_facade" name="product.info.container1" as="container1">
       <action method="setDataByKey"><key>alias_in_layout</key><value>container1</value></action>
       <action method="setDataByKeyFromRegistry"><key>options_container</key><key_in_registry>product</key_in_registry></action>
       <action method="append"><block>product.info.options.wrapper</block></action>
       <action method="append"><block>product.info.options.wrapper.bottom</block></action>
</block>

I want to remove this block of type core/template_facade. How can I do that ?


texts: Magento 2 sort product in catalog product list based on product attribute option position

texts:
I am working with Magento 2, I need to sort the product on category page based n product attribute.

Product attribute type is dropdown.
I will sort the option while creating attribute.

Now in front if I select this attribute product should sort based on option position.
Example :
Product Attribute name : Test
Attribute type is dropdown.
Option 1: sort1
Option 2: sort2
I have two products. Both has diff value assign. Now if I change the options position it should sort accordingly in frontend.
Thanks in advance.


texts:
I'm trying to override a part of an helper of Help Desk MX extension.
So I created a module with the following file:
app/etc/modules/company.xml

<?xml version="1.0" encoding="utf-8"?>
<config>
     <modules>
        <Company_Helpdesk>
            <active>true</active>
            <codePool>local</codePool>
        </Company_Helpdesk>
    </modules>
</config>

app/code/local/Company/Helpdesk/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Company_Helpdesk>
            <version>1.0.0</version>
        </Company_Helpdesk>
    </modules>
    <global>
        <helpers>
            <mirasvit_helpdesk>
                <rewrite>
                    <email>Company_Helpdesk_Helper_Email</data>
                </rewrite>
            </mirasvit_helpdesk>
        </helpers>
    </global>
</config>

app/code/local/Company/Helpdesk/Helper/Email.php

<?php
class Company_Helpdesk_Helper_Email extends Mirasvit_Helpdesk_Helper_Email
{
    public function getHiddenSeparator()
    {
        return "".$this->getSeparator().'';
    }
}

Following this guide: http://inchoo.net/magento/overriding-magento-blocks-models-helpers-and-controllers/

But it doesn't work.

Where am I wrong?


texts: Grunt: Destination [src path] not written because no source files were found

texts:
Currently working with a Magento 2.2.0 theme I made from scratch and I am using Grunt task runner to compile the LESS files to css.

Theme structure in app/design/frontend/<vendor>/<theme_name> is as follows:
theme structure

<theme alias>: {
    area: 'frontend',
    name: '<vendor>/<theme>',
    locale: 'en_US',
    files: [
        'css/styles'
    ],
    dsl: 'less'
}

As I try to run grunt exec:<theme alias>, I always get the following error:

jit-grunt: Plugin for the "&&" task not found.
If you have installed the plugin already, please setting the static mapping.
See https://github.com/shootaroo/jit-grunt#static-mappings

and this is for every part of the code that runs in the background for the specific task. Happens even with sudo. And yeah, I did clean assets beforehand + cache is disabled at all times.

Further on, running grunt less:<theme alias> gets me:

>> Destination pub/static/frontend/<vendor>/<theme_name>/en_US/css/styles.css not written because no source files were found.

Running same command with -v (verbose) flag:

Loading "grunt-contrib-less" plugin

Registering "/var/www/html/mage/node_modules/grunt-contrib-less/tasks" tasks.
Loading "less.js" tasks...OK
+ less

Running "less:<theme alias>" (less) task
Verifying property less.<theme alias> exists in config...OK
Files: [no src] -> pub/static/frontend/<vendor>/<theme_name>/en_US/css/styles.css
Options: banner="", sourceMap, strictImports=false, sourceMapRootpath="/", dumpLineNumbers=false, ieCompat=false
>> Destination pub/static/frontend/<vendor>/<theme_name>/en_US/css/styles.css not written because no source files were found.

Done.

Grunt versions:

grunt-cli v1.2.0
grunt v1.0.1

Had an idea that it could have something to do with permissions at some point when these tasks run, although tried running every command with sudo and fixing permissions to 777, but it's the same error (Destination not written...) for every theme assets there.

While trying to do same in Magento 2.1, there are no errors.

Goal here is to run grunt watch, but the only way I can somehow style the theme is to delete pub/static after every change in LESS, let the Magento do its asset compiling and refresh the browser although I want back the workflow with grunt watch.

How do I fix this?
Thanks in advance, hope this is verbose enough.


texts:
On the success page after the order is displayed, I want to display a summary.
For this I use this code.

I want to display the product image also. How can I achieve that?

And how do I display the summary, with tax and grand total?

<?php
$order_id = Mage::getSingleton('checkout/session')->getLastRealOrderId();
$order_details = Mage::getModel('sales/order')->loadByIncrementId($order_id);
$shipping_address_data = $order_details->getShippingAddress();
?>

                <?php echo $this->__('Description') ?></th
                <?php echo $this->__('Description') ?>
                <?php echo $this->__('Qty') ?>
                <?php echo $this->__('Unit Price') ?>

        <?php foreach($order_details->getAllVisibleItems() as $item): ?>

                <?php echo $item->getSmallImageUrl(); ?>
                <?php echo $item->getName() ?>
                <?php echo round($item->getQtyOrdered(), 0) ?>
                <?php echo Mage::helper("core")->currency($item->getPrice()) ?>

        <?php endforeach ?>

        <?php echo "
" . $shipping_address_data['country_name']; ?>


texts: Show thumbnail images of sub category in top navigation magento 1.9.0

texts:
I am trying to implement the solution detailed here:

How to show the sub category images in Top menu in magento 1.9?

I created a custom module based on the post. However, it brakes the site, I'm getting this error:

Mage registry key "_singleton/catalog/observer" already exists

Here is my file structure:

At app/code/local/Custom/CategoryImage/etc I have the following: config.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Custom_CategoryImage>
            <version>1.0.0</version>
        </Custom_CategoryImage>
    </modules>
    <global>
        <models>
            <categoryImage>
                <class>Custom_CategoryImage_Model</class>
            </categoryImage>
            <catalog>
                <rewrite>
                    <observer>Custom_CategoryImage_Model_Observer</observer>
                </rewrite>
            </catalog>
        </models>
    </global>
</config>

At app/etc/modules have the following xml file: Custom_CategoryImage.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Custom_CategoryImage>
            <active>true</active>
            <codePool>local</codePool>
        </Custom_CategoryImage>
    </modules>
</config>

At app/code/local/Custom/CategoryImage/Model/Observer if have the following Observer.php

class Custom_CategoryImage_Model_Observer extends Mage_Catalog_Model_Observer {

    public function addCategoryImages(Varien_Event_Observer $observer) {
        $block = $observer->getEvent()->getBlock();
        $block->addCacheTag(Mage_Catalog_Model_Category::CACHE_TAG);
        $this->_addCategoriesToMenu(
            Mage::helper('catalog/category')->getStoreCategories(), $observer->getMenu(), $block, true
        );
    }

    public function _addCategoriesToMenu($categories, $parentCategoryNode, $menuBlock, $addTags = false) {
        $categoryModel = Mage::getModel('catalog/category');
        foreach ($categories as $category) {
            if (!$category->getIsActive()) {
                continue;
            }

            $nodeId = 'category-node-' . $category->getId();

            $categoryModel->setId($category->getId());
            if ($addTags) {
                $menuBlock->addModelTags($categoryModel);
            }

            $tree = $parentCategoryNode->getTree();
            $categoryData = array(
                'name' => $category->getName(),
                'id' => $nodeId,
                'url' => Mage::helper('catalog/category')->getCategoryUrl($category),
                'is_active' => $this->_isActiveMenuCategory($category),
                'thumbnail' => $categoryModel->load($category->getId())->getThumbnail()
            );
            $categoryNode = new Varien_Data_Tree_Node($categoryData, 'id', $tree, $parentCategoryNode);
            $parentCategoryNode->addChild($categoryNode);

            $flatHelper = Mage::helper('catalog/category_flat');
            if ($flatHelper->isEnabled() && $flatHelper->isBuilt(true)) {
                $subcategories = (array) $category->getChildrenNodes();
            } else {
                $subcategories = $category->getChildren();
            }

            $this->_addCategoriesToMenu($subcategories, $categoryNode, $menuBlock, $addTags);
        }
    }

}


texts:
Doing an order search via API as follows:

{{magentoEndpoint}}/rest/default/V1/orders?searchCriteria[filterGroups][0][filters][0][field]=status&searchCriteria[filterGroups][0][filters][0][value]=pending&searchCriteria[filterGroups][0][filters][0][condition_type]=eq

However, the following results come back:

{
    "items": [],
    "search_criteria": {
        "filter_groups": [
            {
                "filters": [
                    {
                        "field": "status",
                        "value": "",
                        "condition_type": "eq"
                    }
                ]
            }
        ]
    },
    "total_count": 0
}

As you can see, the value parameter didn't come through.  Can anyone tell why?  Is there some trick to searching orders by status?


texts:
The cron does update the currency rates. But because we want to set them manually I would like to disable the updating of the currency rate.

How could I cancel the auto update of the currency rate but have the cron running?


texts: Data Import errors for skus NOT in store

texts: We have an inventory CSV file (with the fields: SKU, available_inventory, incoming_available) that we upload DAILY. It has 6,800 SKUs, but 600+ are are not in the store, so they generate an error when imported, and if the number of errors exceed 100, the import cannot take place . I need to find a plugin or some code that permits a data import even if there are more than 100 errors. NOTE: We do not want to add those additional SKUs to the store, so that is not an option.


texts: Quantity within side of add to cart in catalog area

texts:
I'm a little new to the magento 2 area and I'm not finding a way to put a quantity counter to be added to the cart next to "add to cart" in the catalog area, as in the illustrative image, I'm using a luma copy as theme, could someone give me a north.
[![enter image description here][1]][1]

Similar to what is already in the cart, but I need to bring it to the catalog part.

[![enter image description here][2]][2]

Magento 2.3.3
Theme: Luma


texts: I want to redirect to the maintains page. Can anyone let me know how can we redirect it from admin panel?


texts: Magento 2 404 on all pages/files (except homepage)

texts:
I setup a Ubuntu server with the LAMP at my home network for testing. I downloaded Magento-CE-2.2.0-2017-09-25-08-19-44.zip and extracted it into /var/www/html and started the installation process. The check was OK, I created the database, the hostname is set to 192.168.5.61, installation seemed to be OK.

But when I clicked the "Launch Magento Admin" at success page, it threw 404. So I visited 192.168.5.61 and the homepage showed, but it was only blank HTML - no styles or other things. I checked the page source code, the styles are linked there

<link  rel="stylesheet" type="text/css"  media="all" href="http://192.168.5.61/pub/static/version1506716871/frontend/Magento/luma/en_US/mage/calendar.css" />
<link  rel="stylesheet" type="text/css"  media="all" href="http://192.168.5.61/pub/static/version1506716871/frontend/Magento/luma/en_US/css/styles-m.css" />
<link  rel="stylesheet" type="text/css"  media="screen and (min-width: 768px)" href="http://192.168.5.61/pub/static/version1506716871/frontend/Magento/luma/en_US/css/styles-l.css" />
<link  rel="stylesheet" type="text/css"  media="print"     href="http://192.168.5.61/pub/static/version1506716871/frontend/Magento/luma/en_US/css/print.css" />

But when I want to view the file, I got 404.
First I thought the .htaccess is missing/ignored, but .htaccess in Magento root has 322 lines and adding random characters to it causes an internal server error, so the .htaccess is working.

Next thing I checked was the /pub/static directory, where all the styles are linked to. But it seems to be a bit empty:

adam@ubuntu:/var/www/html$ tree pub/static
pub/static
├── deployed_version.txt
└── frontend
    └── Magento
        └── luma
            └── en_US
                └── requirejs-config.js

What I did wrong? How to fix it? Still didn't do any work, so deleting everything and starting over is acceptable, but tried 2 times and still the same result.

//EDIT:
Rafael Corrêa Gomes provided an answer on how to recreate the missing files. However, the problem is with permissions settings, as the installer has no permissions to modify the files it creates during installation. My problem is caused by Apache and permission, so it's a bit off-topic for this forums, as it has nothing to do with Magento.


texts: Magento 1.9: Show language switcher on frontend only to users logged in as admin

texts:
I have a website with 2 views and 2 country/language flags switches.
I am hiding the switches with some code and redirecting the users depending on the IP.

However, the sales department must be able to switch between store views to check prices, etc. They cannot install commercial software to connect with different IPs.

My idea was to enable the country/flag selection only if they are logged in as admin.

How do I go about this? Is there another solution server-side?


texts: in magento2 how to get data from loaded model by attribute?

texts:
Trying to load model by name from a category factory:

    $categoryModel = $this->_categoryFactory->create();
    $categoryModel->loadByAttribute('name', 'Other');
    return $categoryModel->toArray(); // this is empty for some reason

I debugged that in resource model, collection query is crafted properly, but why i can't make getData on $categoryModel?

The categoryModel is Magento\Catalog\Model\Category\Interceptor instance, and _data property for some reason is empty, how cat i obtain data from loaded model ?

PS

When I try to load it with load($categoryId) I am not able to make getData().


texts: Magento 2: Mismatched anonymous define() module

texts:
I passed a variable from phtml to js it's working fine but it shows "Mismatched anonymous define() module" error in console.

Phtml File:

<?php $myVar = "This is my value" ?>

<script type="text/x-magento-init">
   {
        "*": {
            "Prince_Faq/js/faq": {
                "animateSpeed": "<?php echo $myVar ?>"
            }
        }
    }
</script>

I tried after changing define() to require(), The error was gone but variable not getting value from config.

Js File:

define ([
    'jquery',
    'jquery/ui'
], function($){
    'use strict';

    return function (config) {
        alert(config.animateSpeed); //Not getting value after changing to require()
    };
});


texts: Magento search Configurable product showing on simple product name

texts:
These are my settings

In Configuration Catalog search is set to Fulltext.

In Attributes only name is searchable.

Configurable products are catalog-search while associated simple products are set to Not visible indivisually.

Configurable Product name is Violet Diamond and one of simple product name is Blackberry Diamond.

So When I am searching for Blackberry, Violet Diamond comes up. This should not happen.

When I changes the name of simple product Blackberry Diamond to something else then it works and nothing comes up in the search.

Anybody have any idea.


texts: Show stock availability in Shopping Cart

texts:
I am new to magento. I want to show stock availability in Shopping Cart. So that if user want to update quantity of items he/she knows how much stock is available for particular item.

I have read many tutorials but unable to find the solution as people is saying stock can't be shown for configurable products.


texts:
I'm trying to get update customers to subscribers in my custom table:

UPDATE `my_contacts_and_subscribers` AS `dc` LEFT JOIN `newsletter_subscriber` AS `ns` ON dc.customer_id = ns.customer_id SET `dc`.`is_subscriber` = 1, `dc`.`subscriber_status` = 1 WHERE (ns.subscriber_status =1)

However this query is hanging, not finishing. Is there anything wrong with it?

Any help appreciated!


texts:
I try to learn how to create a simple module in Magento 2. I create one but I have a lot of errors. If anyone can help me with a sample. How I can create a simple Magento2 module. This module must have the following:

1. to have layout folder (I want to call a custom javascript file that require jquery);
2. template folder (I want to add a phtml file);
3. to have enable / disable option in the admin panel;


texts: Disable a dropdown based on Date attribute

texts: I have created a 2 date attribute which is Date_from and Date_to via back-end. Admin can add these dates and related time slots in another drop-down attribute which is choose_date. In the frontend, there is a calendar written in phtml. When a user chooses a date, I need to disable and enable the dropdown based on the date_from and date_to attribute values. How to do that.


texts: Can I make the Shopping Cart step "mandatory" before going to Checkout (Magento 1.9)?

texts:
We have created a Coupon Code for free shipping, and our cart widget displays two buttons (links):

one goes to the Shopping Cart screen (where people can enter the Cupon Code)
the other goes to the One Page Checkout (where people cannot do it)

We'd like to make the Shopping Cart step mandatory, we thought about removing the Checkout links, but we want to make sure we have some setting / way to make it a mandatory step anyways.
Thanks for your help,


texts: Currency Selector not reflecting changed currency in footer due to magento cache

texts:
I have two currency selector in my magento store one in header and other in footer.

When magento cache Blocks HTML output is disabled then both currency selector reflecting correct currency on change currency using any of selector.

But when magento cache Blocks HTML output is enabled from admin then currency selector in header reflecting correct currency but footer currency selector not showing correct currency on change currency.

How to resolve this with enabled magento cache?


texts: How to assign extension package icon when uploading to Magento Connect

texts:
I have a Magento 2 extension that I'm trying to upload to Magento Connect. When I drag and drop my zip package for review, a default extension icon is shown. I've searched online (see attached image) and if I understand correctly, there should be a form where I can specify the extension icon, but I can't find it.

How do I change the extension's package icon?


texts:
I am using Magento 1.9 and I wanted to change the currency display from
180,00 currency Symbol  TO  currency Symbol 1.800,00
please help me with the issue
I have not overridden any module its base code


texts: Magento 2: What is the Downloads Report in report menu?

texts: Any idea about what is the use of this report?


texts: Product not returning it's short description

texts:
in a template I am calling function in a block using:

$_product = Mage::registry('current_product');
<?php echo $this->getProductEncode($_product); ?>

The function  getProductEncode then returns some json-ld encoded text.  However, when I use this function:

$description = $product->getShortDescription();

Nothing is description is set to " '' ".  Why is this?  If I remember correctly, short descriptions IS part of products, right?  I looked in our backend and it's definitely set for the product in question.  Is there a workaround available?

I don't understand why magento instantiates only minutely different implementations of a 'product' seemingly at random.

Mage::log($product->debug(), null, 'testing.log', true);

Does not display short description as part of this product.  Other areas of my store use the above getShortDescription() on product to retrieve it.


texts: how to add a top link in custom module at prefered position

texts:
Can anyone let me know how to add custom top link on top menu after create an account link or at any place I want to put before/after.

I have tried with after attribute but its not changing position as I want.

Thanks.


texts: Product search does not work due to addVisibleInSiteFilterToCollection

texts:
I have enabled my products visibility for both list page and search.
But when I use

  Mage::getSingleton('catalog/product_visibility')->addVisibleInSiteFilterToCollection($products);

the products does not displayed.

What does addVisibleInSiteFilterToCollection do?

Thanks

EDIT

I have installed a module. I think that module checks the products visibility with function addVisibleInSiteFilterToCollection. But no products are displayed. I have checked my all products are visible in both catalog and search.
I am curious what exactly this function does? Because when I comment this function I can see my products.


texts: Display Custom Attribute Multiplace Place on Products Details Page Magento 2

texts:
I'm adding code on attribute.phtml page for call custom attribute on the products details page

<div class="product attribute <?= /* @escapeNotVerified */ $_className ?>">
<?php

$upc_code = $_product->getResource()->getAttribute('upc_code');
if ($upc_code){
    // Get Value
    $upc_value = $upc_code->getFrontend()->getValue($_product);
    // Get Label
    $upc_lable = $upc_code->getStoreLabel();
    echo $upc_lable." : ".$upc_value;
}
?>
</div>

  vendor/magento/module-catalog/view/frontend/templates/product/view/attribute.phtml

but there are issues it's call 3 place

want to display  under SKU

please help me

Thank you


texts: Magento 2 minicart, welcome message, other do not work with page cache disabled after customer login

texts:
With Magento 2.0.4 cache, more specifically page cache enabled, everything works.

If I disable it, clear cookies, and login as customer than products in minicart are not there.

Welcome message does not really work right.
I have to add a product to cart from a product page in order to see the minicart. Than if I go to checkout, country is not displayed in address summary (shipping address already added in my account).

I've done debugging and it looks like the problem is pointing to:
module-customer/view/frontend/web/js/customer-data.js.
The cookie private_content_version is set in module-page-cache/view/frontend/web/js/page-cache.js and used in customer-data.js. See customerData::reload function.

With page cache disabled, the data is not loaded from the server as the function dataProvider::getFromServer() does.

When page cache is disabled the cookie private_content_version is not there (page-cache.js is not executed off course). But the cookie section_data_ids has only '*' and 'messages' => empty (false or null).

When page cache is enabled there is private_content_version and section_data_ids has what keys with values:

*:      null
cart:       123
compare-products:       123
customer:       123
directory-data:     123
last-ordered-items:     123
multiplewishlist:       123
review:     123
wishlist:       123

After I login with page cache enabled, on customer dashboard there are 2 additional ajax requests that load data:

http://test.localhost/customer/section/load/?sections=&update_section_id=false&_=123
http://test.localhost/customer/section/load/?sections=directory-data&update_section_id=false&_=123

These contain json objects with customer specific data and directory data like all countries and regions.
With these calls, on checkout the address summary displays the country name.
See: module-customer/view/frontend/web/js/sections-config.js
and module-checkout/view/frontend/web/js/view/shipping-address/address-renderer/default.js, function getCountryName.

Is this a Magento 2 bug or it's something that I messed up ?
Thanks


texts: magento 2 remove shipping amount from cart total

texts:
I want to remove shipping amount from cart page because we do not provide estimate shipping amount calculation block.

Also, when customer add product to cart then its display grand total without shipping amount but if customer in checkout page and select shipping method and again back to cart page then cart grand total display amount including shipping amount and shipping method and amount not display here.

Please see below images.

For this I have override cart index controller in custom module and code is as below.

1) app/code/Hs/Mageenhancement/etc/di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Checkout\Controller\Cart\Index" type="Hs\Mageenhancement\Controller\Cart\Index" />
</config>

2) app/code/Hs/Mageenhancement/Controller/Cart/Index.php

    <?php

namespace Hs\Mageenhancement\Controller\Cart;

class Index extends \Magento\Checkout\Controller\Cart\Index
{
    /**
     * Shopping cart display action
     *
     * @return \Magento\Framework\View\Result\Page
     */
    public function execute()
    {
        $quote = $this->_checkoutSession->getQuote();
        $shippingMethod = $quote->getShippingAddress()->getShippingMethod();
        if($shippingMethod){
            $quote->getShippingAddress()->setShippingMethod(null);  //setting method to null
            $quote->save();

            $quote->collectTotals();
            $quote->save();
        }
        $resultPage = $this->resultPageFactory->create();
        $resultPage->getConfig()->getTitle()->set(__('Shopping Cart'));
        return $resultPage;
    }
}

I have used same below technique in Magento 1 and its working fine but in Magento 2 its not working.

$quote = $this->_checkoutSession->getQuote();
        $shippingMethod = $quote->getShippingAddress()->getShippingMethod();
        if($shippingMethod){
            $quote->getShippingAddress()->setShippingMethod(null);  //setting method to null
            $quote->save();

            $quote->collectTotals();
            $quote->save();
        }

Please help me how to remove shipping charge in cart page.


texts: routers and updates node relation in config.xml

texts:
I was trying to add a phtml file via update xml for one of my custom module

am pasting my config.xml file here

<config>
  <frontend>
    <routers>
            <integer>
                <use>standard</use>
                <args>
                    <module>Foo_Bar</module>
                    <frontName>integer</frontName>
                </args>
            </integer>
        </routers>
        <layout>
            <updates>
                <integer>
                    <file>integer.xml</file>
                </integer>
            </updates>
        </layout>
  </frontend>
</config>

This works perfect for me.

I had learned that immediate node under the 'router' node is just an identifier.so i changed it to some other value and correspondingly i changed the immediate node under 'updates' also to the same value.but it was not working. then i thought my 'frontName' value should be the node under 'updates', and i changed accordingly. but again layout update was not working.

Queston: what should be the node under 'upates' node?
'frontName' value OR
the same node under 'routers' OR
both the nodes should match frontName value?

EDIT:

<config>
  <frontend>
    <routers>
            <integer>
                <use>standard</use>
                <args>
                    <module>Foo_Bar</module>
                    <frontName>integer</frontName>
                </args>
            </integer>
        </routers>
        <layout>
            <updates>
                <something>
                    <file>integer.xml</file>
                </something>
            </updates>
        </layout>
  </frontend>
</config>

This config also working perfect for me.

Am getting increasingly curious about the relations now

UPDATE:My layout updates are only working when my <frontName> value matches the node name immediately under <routes> node. But routes work properly if they are not same

Somebody please explain my problem.or is it not a problem?


texts: How to create readable subfolder in Magento root

texts:
So, I am working with Magento 1.9 and I want to create a new subfolder in the Magento root in order to put my scripts.

The matter is, in localhost everything is working fine. I can browse /scripts without any problem. However, when I try to access /scripts from the website Magento root I get 403 error forbidden.

Why is that? How can I fix it?

I tried to copy the live website .htaccess in the localhost but doing so I still manage to browse /scripts without any error.

So it seems it isn't an .htaccess problem, maybe has something to do with permission? The Magento root and all its subfolders are of course not readable, but then how can I create a browsable subdirectory?

Is there maybe a folder inside Magento where I can run my custom scripts or how can I create a readable subfolder in Magento root?


texts: Is it possible to select place holder image for products without changing configuration in admin or directly uploading to magento folder ?

texts:
Is it possible to make magento show my place holder images which is stored in a particular folder without changing the admin configuration or directly uploading file to magento default folder.

What i am expecting was is there a config file which I can say these are the placeholder images and pick these in magento ?


texts: Magento2 : How to change Email Sender for Sub Website

texts:
I have created two website in my Magento2 CMS, also changed all Store Email Addresses for Sub Website Store view, but still in mails from sub website (like order confirmation, new account email) sender id is coming from default config setting.

How do I do change all sender email in sub website?


texts:
Sometimes when my customers places order they don't make the payment but they would later ask how to make a payment for the order which is already placed and not paid for.

Is there a way my customers would be able to make payments for orders which they have not paid yet?

I searched everywhere but was not able to find any solution for this.


texts: Current store is 1 when running upgrade scripts

texts:
Any idea why Mage::app()->getStore() returns the store view with id 1 when inside the upgrade scripts independent on the store view I'm running the upgrade script in (even admin)?
I mean, I know where the code that does this is. In Mage_Core_Model_App::getStore() there is this:

    if (!Mage::isInstalled() || $this->getUpdateMode()) {
        return $this->_getDefaultStore();
    }

and _getDefaultStore looks like this:

   if (empty($this->_store)) {
        $this->_store = Mage::getModel('core/store')
            ->setId(self::DISTRO_STORE_ID)
            ->setCode(self::DISTRO_STORE_CODE);
    }
    return $this->_store;

$this->_store is always empty when reaching the method above.

I get the same result even if I add this at the top of the upgrade script:

Mage::app()->setCurrentStore(Mage::getModel('core/store')->load(Mage_Core_Model_App::ADMIN_STORE_ID));

I'm curious about the business logic of having this 'feature'.


texts: Magento change key product attributes default value

texts:
I'd like to speed up product creation in the way that i don't have to select fields that never change for my store every time i add product.

Fields that i need to have default value are:

Status - Enabled
Weight - Zero by default
Tax Class - Taxable Goods
Product In Websites - Main Website Store
Auto Select radio "Base Image, Small Image, Thumbnail" to image that has order 1.

When i go to attribute manager and edit e.g. "status" its set to be dropdown, but "Manage Options (values of your attribute)" field is empty and adding options there has no effect.

Is there extension or easy way i can edit this i don't mind editing core files.


texts:
I am working on Multivendor Extension in which i am trying to create multiple order on one checkout if the quote has products from multiple vendor.

Below is the code i am working on rewritten from Mage_Checkout_Model_Type_Onepage, When i click on place order the progress gets terminated in middle. i dont know what is going wrong

public function saveOrder()
{
$quote = $this->getQuote();

// First build an array with the items split by vendor
$sortedItems = array();
foreach ($quote->getAllItems() as $item) {
    $vendor = $item->getProduct()->getVendor(); // <- whatever you need
    if (! isset($sortedItems[$vendor])) {
        $sortedItems[$vendor] = $item;
    }
}
foreach ($sortedItems as $vendor => $items) {
    // Empty quote
    foreach ($quote->getAllItems() as $item) {
        $quote->removeItemByKey($item->getId());
    }
    foreach ($items as $item) {
        $quote->addItem($item);
    }
    // Update totals for vendor
    $quote->setTotalsCollectedFlag(false)->collectTotals();

    // Delegate to parent method to place an order for each vendor
    parent::saveOrder();
}
return $this;
}

if you have any alternative approach please share with me.


texts: css alignment issues text is dispalying too below

texts:
please visit these links :

we are using a magento platform

if tier prices are available than its displaying like this :

if tier prices are not available, than its displaying like this :

means ,

this text "10 days Replacement Guarantee" is

displaying too much below.

please help me to make proper alignement as like in first link.


texts: Custom attribute filter for product listing not working

texts:
I am trying to filter products using category and products with categorie and location but the filter not working here's my code

<?php
$ty=array(34,15);
foreach($ty as $categoryid) {
$category = new Mage_Catalog_Model_Category();
$category->load($categoryid); //My cat id is 10
$prodCollection = $category->getProductCollection();
$prodCollection->addAttributeToSelect('name','product_location');
$prodCollection->addAttributeToFilter('product_location', array('like' => 'Bangalore, Karnataka, India'));
foreach ($prodCollection as $product) {
$prdIds[] = $product->getId(); ///Store all th eproduct id in $prdIds array
}
foreach($prdIds as $_prdIds){
$product_id = $_prdIds;
$obj = Mage::getModel('catalog/product');
$_product = $obj->load($product_id); // Enter your Product Id in $product_id
$prdId1s[]=$_product;
}
$_productCollection = $prdId1s;
}
?>


texts: Imported simple products are not associated with their parent configurable products

texts:
I have exported all my products using Dataflow - Profiles, and when I try to import these products again using same original CSV file (to a fresh Magento website), all products are imported, but simple products are not associated with their parent configurable products (also when I open one of configurable products, I see
"Select Configurable Attributes" screen.) My Magento version is 1.9.2.1.


texts: Frontend login not working in Chrome with https enabled (1.9)

texts:
For what I can see in questions already posted, Chrome may be a bit 'fussy' when it comes to cookies and login issues in newer versions of Magento.

The problem I'm experiencing concerns secure mode and Chrome only. If https is enabled, login in the frontend is not possible. If it is disabled, login works fine.

If wrong details are entered, I get the usual error messages, so form is definitely submitting. Because of this, I don't think this is a problem with form keys.

If input details are correct, Chrome shows the login page again with no message at all.

There are no issues in Firefox and everything works as it should.

Posted questions I've read do not seem to apply to the case of HTTPS only. So I'm a bit lost.

Has anyone experienced this issue and knows how to solve it?


texts: "cannot do shipment for the order" and "Invalid security or form key, please refresh the page" error. Magneto 2.3

texts:
We have an issue when we are trying to complete shipment.
We have the "email copy of Shipment" box checked. And when we click "submit shipment" we receive these two error messages:
"cannot do shipment for the order" and "Invalid security or form key, please refresh the page"
But the shipment is completed and the email copy is sent. I have checked the log and reports folder for any errors but nothing that indicates there is an issue at all.
Anyone that knows what causes this? Is not that bad, but since our client thinks there is something wrong when this is happening.
Any help is appreciated.,


texts: How to translate string from extension controller to AJAX call?

texts:
I want to use my local theme's locale csv file to translate a status message that comes from a plugin and is called in the theme via AJAX. I'm not sure how or where though.

My plugin creates 'packages' of several existing products and shows them as "Joint deals" on a product page. In the CartController.php this response is made:

        $response = $this->prepareResponse([
            'status' => 'SUCCESS',
            'message' => 'Your package was added to cart',
        ]);

In my product view.phtml the response is called via an AJAX call like this:

        try {
            $j.ajax({
                 ...
                success: function(data){
                    $j('product-a2c-popup popup-content span.content').text(data.message);

So in other words the message is taken from the response straight from the extension. But how/when would I wrap that message in the echo $this->__ format?
If I do it in the extension itself, how would the mark-up be seeing as it is written in an array?


texts: Invalid category Exception is thrown when I try to loadproductcollection from a magento cron job?

texts:
I am creating a Cron job to do some operations in the product collection and I have defined a block for my job. I have extended my block from Mage_Catalog_Block_Product_List. But the block is not getting converted to html, its failing in the beforeHtml call. When trying to load the product collection. And by tracing back I have found that the exception thrown is category invalid.

The template is loaded for an email, using block inside the email template.

Block - availableproducts.php

class Test_Module_Block_Availableproducts extends Mage_Catalog_Block_Product_List
{

    public function getAvailableProducts()
    {

    }

    public function getLoadedProductCollection()
    {
        //return parent::_getProductCollection();
        return $this->_getProductCollection();
    }
}

Block Init from Email template

{{block type="test_module/availableproducts" area="frontend"  category_id="4" template="email/availableproducts.phtml"}}


texts: how to override express_checkout.xml in magento2?

texts:
I want to add some more configuration fields in express checkout.

How to override express_checkout.xml in Magento 2?


texts:
I'd like to add the category title to the product view page in Magento. I have the following code that currently pulls the category banner to the product view page:

<?php
    if(Mage::registry('current_category')):
        $_category=Mage::registry('current_category');
        $_helper    = Mage::helper('catalog/output');
        $_imgHtml   = '';
        if ($_imgUrl = $_category->getImageUrl()) {
            $_imgHtml = '
escapeHtml($_category->getName()).'" title="'.$this->escapeHtml($_category->getName()).'" />
';
            $_imgHtml = $_helper->categoryAttribute($_category, $_imgHtml, 'image');
        }
?>
    <?php if($_imgUrl): ?>
        <?php echo $_imgHtml ?>
    <?php endif; ?>

<?php endif; ?>

Can I adapt the above so the category title is also displayed?


texts: How to connect Third party service like ERP system in Magento 2?

texts:
How to establish the connection of third party ERP system in magento
2 ?
I have credential of Acumatica, How can I establish the connection in
Magento 2 and set some data to that ERP system, and Also the fetch
the data from third party ERP system.
Any guidance regarding third party connection with Magento 2 will be
helpful.

  Note : I am aware about API integration but How to establish the
  connection for that particular third party ERP in Magento 2 ?


texts:
I'm using 2.2.6,

How to remove setup page magento 2 when installed after

like http://xxxx.com/setup/index.php/session/unlogin

thank you!


texts: Magento Command Line steps for updating code files on server in Production

texts: What are the steps to add a module on Production Store Site for Magento.  Do I switch to maintenance mode from Production then run the php bin/magento setup:upgrade and other commands then turn off maintenance mode then switch back to production? Just wanted to make sure the proper way to update a production site.


texts:
I created 2 E-Mail templates in Magento2. A Header and a footer.

In the header i can normally add in Template style below my style.

But in the footer Template Style area, it is not reading my css.

Am i doing something wrong or do i need to add a script tag or something else ?

Greets


texts: Where Can I edit the Order totals table in Magento OrderEmails

texts:
Can you please help me to find where order totals table added and how to edit the totals table in the order emails.

I need to edit the discount word in the following image when a shopping cart rule applied.


texts: How to Get order data after placing the order in checkout

texts:
I want to implement custom payment gateway with redirect. I found a lot of questions about it here.

(Like Payment gateway with redirects in magento2. )

From which I think I have two options.

After placing order, redirect customer to my custom controller, there have some logic and then redirect him to gw.
Make AJAX req to my custom controller, that returns gw url, and redirect user there with JS.

But, in my custom controller, I somehow need to get the newly created order data, or at least id. Presumably, I should send them in my redirect/ajax req. But I don't know how.

Currently, my code in method-render looks like this:

return Component.extend({
    defaults: {
        template: 'Vendor_Module/payment/template',
        redirectAfterPlaceOrder: false
    },

    afterPlaceOrder: function () {
        $.mage.redirect(
            url.build('route/controller/action')
        );
    }

});

Is there a way I can add order data to the request? Or is there any other way I can retrieve order data in controller?

Note: In controller tried this

    /**
     * @var \Magento\Checkout\Model\Type\Onepage\Interceptor $onepage
     */
    $onepage = $this>_objectManager>get('Magento\Checkout\Model\Type\Onepage');
    $orderId = $onepage->getLastOrderId();

But I don't think it's transaction save. I get an id even when I do random get request on my controller. Also I don't know how this behave when two orders are placed at the same time.


texts: not working one form two buttons to submit

texts:
i have phtml file which has two submit buttons of type submit or button. Either is not working. If i mention one button type as submit and other type as button, then its not posting the values in the redirected page.

<form id="form1" method="get">
    ID: <input type="text" id="ID" name="ID">

    Title: <input type="text" id="title" name="title">

    File Name: <input type="text" id="FileName" name="FileName">

    Content: <input type="text" id="Content" name="Content">

    Status: <input type="text" id="Status" name="Status">

<input type="button" name="save" value="Save"
                                                onclick="setLocation('<?php echo Mage::getUrl("test/index/save"); ?>')" />
    <input type="submit" name="Load" value="Load"
           onclick="setLocation('<?php echo Mage::getUrl("test/index/load"); ?>')" >

</form>


texts: how to add quantity respected product size in Magento 1.9

texts:
How to add quantity respected product size in Magento 1.9

Please Help me


texts: How to load javascript file by using a layout file

texts:
Here in below code i am trying to load captcha.js file but its not loading.

  app/design/frontend/base/default/layout

<reference name="product.info">
    <block type="questionanswer/questionanswer" name="product.questionanswer" as="questionanswerAs" template="questionanswer/form.phtml">
        <action method="addToParentGroup"><group>detailed_info</group></action>
        <action method="setTitle" translate="value"><value>Ask A Question</value></action>
        <block type="captcha/captcha" name="captcha">
            <reference name="head">
                <action method="addJs"><file>mage/captcha.js</file></action>
            </reference>
            <action method="setFormId"><formId>vendor_form</formId></action>
            <action method="setImgWidth"><width>230</width></action>
            <action method="setImgHeight"><width>50</width></action>
        </block>
    </block>
</reference>

and in custom module config.xml file

<default>
    <captcha>
        <frontend>
            <areas>
                <vendor_form>
                    Question_Answer Page
                </vendor_form>
            </areas>
        </frontend>
    </captcha>
    <customer>
        <captcha>
            <always_for>
                <vendor_form>1</vendor_form>
            </always_for>
        </captcha>
    </customer>
</default>

  and in phtml file

    <?php echo $this->getChildHtml('captcha'); ?>


texts:
I am a new to magento forntend devloper i tried search for this solution i am not getting any solution. This is my custom theme folder structure in Magento 2.2.2 i saved default_header_html.xml file in the following way in layout folder..

  app/design/frontend/custom-theme/my-first-theme/view/layout/default_header_html.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>
            <css src="../../web/css/abc.css"/>
        </head>
    </page>

My css folder path

  app/design/frontend/custom-theme/my-first-theme/web/css/abc.css

using above xml file i tried to access abc.css file but not working. Can u please help me for accessing my abc.css file


texts: Which Magento version is best for windows local development?

texts:
This might sound subjective but I can't help but to post it here in the Stack.
I was really struggling with Magento 2 installation setup.
I am trying to setup a Magento 2 local windows dev environment using some of the latest Magento versions, I used composer version 1.10.x, attempted to install versions starting from 2.3.6 to 2.4.1, but none of them work.
I got stuck. I have done all the best possible options but none of them seem to work in my desktop machine using Windows 10. All I got was bunch of installation errors.
Currently, I am trying to setup a VM using virtualbox with Ubuntu. I hope this will make things easier.


texts: Delete products from order programmatically

texts:
I use Magento CE 1.8.1.0 and I have developed a php script that can delete a product from an order. After the product is deleted the value of the order is the same. How can I reduce the order value with the amount of the deleted product?

My script:

$base_grand_total = $order->getBaseGrandTotal();

$base_subtotal = $order->getBaseSubtotal();
$base_tva = $order->getBaseTaxAmount();

$grand_total = $order->getGrandTotal();

$subtotal = $order->getSubtotal();
$tva = $order->getTaxAmount();

$base_subtotal_incl_tax = $order->getBaseSubtotalInclTax();

$subtotal_incl_tax = $order->getSubtotalInclTax();

$total_item_count = $order->getTotalItemCount();

$item_price = $sItem->getPrice();

$item_tva = $sItem->getTaxAmount();

$sItem->delete();

$order->setBaseGrandTotal($base_grand_total-$item_price-$item_tva);

$order->setBaseSubtotal($base_subtotal);

$order->setBaseTaxAmount($base_tva-$item_tva);

$order->setGrandTotal($grand_total-$item_price-$item_tva);

$order->setSubtotal($subtotal-$item_price);

$order->setTaxAmount($tva-$item_tva);

$order->setBaseSubtotalInclTax($base_subtotal_incl_tax-$item_price);

$order->setSubtotalInclTax($subtotal_incl_tax-$item_price);

$order->setTotalItemCount($total_item_count-1);

$order->save();


texts: Cannot install Magento Cloud cli on local

texts: I have problem with install the Magento 2 CLI on my local, do you know what can I do next? thanks


texts: Multiple URLs found for index page (solved)

texts:
Actually, there is no index.php in urls of our website but the home page only. So to solve the "Multiple URLs found for index page" seo issue, with below changes in nginx configuration I could remove it from "landing page". But now I have problem to access admin panel.

if ($request_uri ~ .*.index\.php(.*)) {
return 301 http://test.example.com;
}


texts: Magento 2 : TypeError: Argument 1 passed

texts:
I am getting below error on rest api call on this method
public function handleDecline($order)
    {
        $result = $this->forterConfig->getDeclinePost();
        if ($result == '1') {
            $this->customerSession->setForterMessage($this->forterConfig->getPostThanksMsg());
            if ($order->canHold()) {
                $order->setCanSendNewEmailFlag(false);
                $this->decline->holdOrder($order);
                $this->setMessageToQueue($order, 'decline');
            }
        } elseif ($result == '2') {
            $order->setCanSendNewEmailFlag(false);
            $this->decline->markOrderPaymentReview($order);
        }

        throw new PaymentException($this->forterConfig->getPostThanksMsg());
    }

TypeError: Argument 1 passed to Magento\Framework\Exception\LocalizedException::__construct() must be an instance of
Magento\Framework\Phrase, string given, called in
Any thoughts how this can be solved ?
I think this is related to type of "$this->forterConfig->getPostThanksMsg()"


texts:
How to add product in cart page when rule id match.
I am trying to add a product while coupon code applying from the cart page.


texts:
we would like to do a Magento state and status flow analyses. In short: a count over all orders grouped by unique state and status flow.

new -> payment pending -> cancelled #3
new -> payment pending -> payment complete -> completed #54
new -> awaiting payment #16

This does look as a very difficult query as the status and state is stored in the history table in separate rows. So one would have to capture the complete table. Then group by order and sort by date. Extract and print the order id, then the statuses based on sorted date + do a count over the number of orders using this path.

Hmmmm - writing this gives some ideas, but also seems quite complex


texts:
The code:

    public function testAction(){
        $Collection = Mage::getModel('catalog/product')->getCollection();
        $Collection->getSelect()->join(array('t2' => 'SELECT product_id FROM sales_flat_quote_item GROUP BY product_id ORDER BY SUM(qty) DESC;'), 'e.entity_id = t2.product_id', 't2.product_id');

        foreach($Collection as $c){
            var_dump($c);
        }
    }

Here is the error trace.

Incorrect table name sales_flat_quote_item?

What's the problem here? I'm tempted to manually create the whole query and be done with it.. :)

Thanks.


texts: Error in collection record update Magento 2

texts:
I have a custom collection I wanted to update a record. I want to do this as below:

foreach ($creditDetails as $Card) {

        echo $Card->getRedeemAmount();
        $Card->setRedeemAmount(44);
        echo $Card->getRedeemAmount();
        //exit;
        $Card->save();
        exit;

but Card is not getting save. Initially it was working but I don't know what problem has occurred now. Please a suggest solution.


texts:
I'm working on an extension where I want to do something programmatically whenever a user favorites a product in a Magento store.  However — core Magento doesn't the concept of a favorite event,  users usually use a free or commercial extension to achieve this sort of functionality, and every extension will implement this in a different.

Has anyone compiled a list of these sort of events?

Since my guess to the above is no — if you're using an extension like this, which event(s) would you hook into to track a user who marks a products as a favorite?

I know I could download all 6000+ Magento connect extensions and parse these for canidate events, but that leaves out commercial extensions like the Amasty extension.


texts: Can't Access Admin Panel after changing Base URL in Magento 2.1.3

texts:
I made a mistake. I changed the Admin Base URL and now I can't access the admin site.

In the core_config_data table,I edited the following rows in the database:

Scope:"Default" and Path:"admin/url/custom"

Select the NULL checkbox and save.

Scope:"Default" and Path:"admin/url/use_custom"

Change value from 1 to 0 and save.

I deleted the following rows:

Scope:"Stores" and Path:"web/secure/base_url"
Scope:"Stores" and Path:"web/unsecure/base_url"


texts: How to get Bundle product minimum price for each group programatically

texts:
I'm developing an api in Magento 2 that will return bundle products minimum prices for each group. Magento shows the price on front end when particular customer of a group logged in, in my case customer will not logged in. I am using below code for each available customer group by passing group id but it gives same price in all customer group.

$product->setCustomerGroupId($groupId);
$bundleObj = $product->getPriceModel()->getTotalPrices($product, null, null, true);

Thanks.


texts: System.log error simplexml_load_string (Extra content at the end of the document)

texts:
System.log error

2016-02-04T03:16:25+00:00 ERR (3): Warning: simplexml_load_string(): Entity: line 9: parser error : Extra content at the end of the document  in /var/www/html/magento/app/code/core/Mage/Core/Model/Layout/Update.php on line 450
2016-02-04T03:16:25+00:00 ERR (3): Warning: simplexml_load_string(): &lt;reference name=&quot;left&quot;&gt;  in /var/www/html/magento/app/code/core/Mage/Core/Model/Layout/Update.php on line 450
2016-02-04T03:16:25+00:00 ERR (3): Warning: simplexml_load_string(): ^  in /var/www/html/magento/app/code/core/Mage/Core/Model/Layout/Update.php on line 450
2016-02-04T04:00:17+00:00 ERR (3): Warning: simplexml_load_string(): Entity: line 9: parser error : Extra content at the end of the document  in /var/www/html/magento/app/code/core/Mage/Core/Model/Layout/Update.php on line 450
2016-02-04T04:00:17+00:00 ERR (3): Warning: simplexml_load_string(): &lt;reference name=&quot;left&quot;&gt;  in /var/www/html/magento/app/code/core/Mage/Core/Model/Layout/Update.php on line 450
2016-02-04T04:00:17+00:00 ERR (3): Warning: simplexml_load_string(): ^  in /var/www/html/magento/app/code/core/Mage/Core/Model/Layout/Update.php on line 450

this is my Update.php

 // custom local layout updates file - load always last
    $updateFiles[] = 'local.xml';
    $layoutStr = '';
    foreach ($updateFiles as $file) {
        $filename = $design->getLayoutFilename($file, array(
            '_area'    => $area,
            '_package' => $package,
            '_theme'   => $theme
        ));
        if (!is_readable($filename)) {
            continue;
        }
        $fileStr = file_get_contents($filename);
        $fileStr = str_replace($this->_subst['from'], $this->_subst['to'],$fileStr);
        $fileXml = simplexml_load_string($fileStr,$elementClass);
        if (!$fileXml instanceof SimpleXMLElement) {continue;}
        $layoutStr .=$fileXml->innerXml();
                                            Mage::log(print_r($filename, true));
    }
    $layoutXml = simplexml_load_string('<layouts>'.$layoutStr.'</layouts>',$elementClass);
    return $layoutXml;
}

}


texts: Can't get stock in getStockQty() at app\code\core\Mage\CatalogInventory\Block\Stockqty\Abstract.php

texts:
i just found that the isMsgVisible() do not get the stock by using $this->getStockQty(), the full function are as follow:

public function isMsgVisible()
{
    return ($this->getStockQty() > 0 && $this->getStockQty() <= $this->getThresholdQty());
}

The getStockQty()

public function getStockQty()
{
    if (!$this->hasData('product_stock_qty')) {
        $qty = 0;
        if ($stockItem = $this->_getProduct()->getStockItem()) {

            //$qty = (float) $stockItem->getStockQty();
            $qty = (float) $stockItem->getQty();
        }
        $this->setData('product_stock_qty', $qty);
    }
    return $this->getData('product_stock_qty');
}

The $stockItem->getStockQty() is always return 0, i have to change to getQty() to make it works. Is it a bug? i'm not dare to patch to production site now.


texts: First Cloud Staging Deployment - home page not available

texts: I did my first merge from integration to staging environments, however the staging home page is not available.


texts: Getting no of Orders Within a Specified Date

texts:
I am trying to a get a list of orders for a particular date.That date is -5 days from today's date.This will check for everday.

$_lastWeek = date("Y-m-d", mktime(0, 0, 0, date("m"), date("d") - 5, date("Y")));
$_startOfDay = Mage::app()->getLocale()
    ->date(Mage::getModel('core/date')->timestamp($_lastWeek))
    ->setTime('00:00:00')
    ->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);
$_endOfDay = Mage::app()->getLocale()
    ->date(Mage::getModel('core/date')->timestamp($_lastWeek))
    ->setTime('23:59:59')
    ->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);
$orders = Mage::getModel('sales/order')->getCollection()
    ->addAttributeToFilter('created_at', array(
        'from' => $_startOfDay,
        'to'   => $_endOfDay,
        'date' => true
    ))
    ->addAttributeToFilter('status', Mage_Sales_Model_Order::STATE_COMPLETE);

Even though there are couple of orders on that date, its not returning. If I mention:

$date = strtotime('6-7-2013 -5 days');
$_lastWeek = date('Y-m-d', $date);

Its returning the number of orders. How do I find number of orders for a date that is -5 days from each day?


texts: How do I amend Magento 2 'Bundle' products layout in PDF Invoices?

texts:
I've successfully amended my Magento 2 PDF invoices, changing the styling, adding a footer etc. I've managed to move the 'Qty' so that it's first in the item list, as below:

However, I can't seem to find out how to amend the items if a bundle product is added:

I would like to move the 'Qty' first, and add the individual bundled items SKUs (in the correct place - the example above's SKU (QUARTERLY) is still in the original position of the default invoice).
I've overridden the following files, but don't seem to be able to find / change the bundle product options.
Magento\Sales\Model\Order\Pdf\Invoice.php
Magento\Sales\Model\Order\Pdf\Items\Invoice\DefaultInvoice.php


texts:
i want to get product seo url from id

below is code i used to get url from id

$my_product = Mage::getModel('catalog/product')->load($id);
$my_product_url = $my_product->getProductUrl();

but above code gives url like :
catalog/product/view/id/226/s/slot-ring/category/58/

how to get seo url here like :
/rings-10/start-with-setting.html


texts: Prices of configurable products missing in price index

texts:
We have a problem with the Magento store of one of our customers. The prices of all configurable products are missing in price index. Do you have any ideas how we can debug this? What we have tried so far:

Deactivate all local and community modules
Create new products
Change relevant data in the backend

The Magento version is 1.9.1.0.


texts: Magento 1.9.2.3 cannot show products on homepage

texts:
I tried the code:-

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

On my CMS > page but the products of the categories are not coming instead, it is breaking the homepage. Can Any one provide me the full procedure to add products of specific category on my homepage (cms page) in Magento 1.9.2.3


texts:
Can anyone tell me how to get the product collection from the below method.
Is this the right way of fetching data in magento2?

\Vendor\Module\Helper\Data $tglssearchHelper,

protected function _getProductCollection()
{
    $tagalys = $this->tglssearchHelper->getTagalysSearchData();

        if ($tagalys == false) {
            return parent::_getProductCollection();
        } else {

        $searchResult = $tagalys;

        if (empty($searchResult)) {
            return parent::_getProductCollection();
        }

        $collection = $this->_productCollection = $this->catalogResourceModelProductCollectionFactory->create()
             ->addAttributeToSelect($this->catalogConfig->getProductAttributes())
             ->setStore($this->storeManager->getStore())
             ->addFieldToFilter('visibility', \Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
             ->addAttributeToFilter( 'entity_id', array( 'in' => $searchResult['results'] ) );  echo 'list product';print_r($collection);die;

        $orderString = array('CASE e.entity_id');
        foreach($searchResult['results'] as $i => $productId) {
            $orderString[] = 'WHEN '.$productId.' THEN '.$i;
        }
        $orderString[] = 'END';
        $orderString = implode(' ', $orderString);

        $collection->getSelect()->order(new \Zend_Db_Expr($orderString));

        return $this->_productCollection;
    }
}

My helper /Data

public function getTagalysSearchData()
{
    $service = $this->isTagalysActive();
    if ($service) {
        $searchResult = $service->getSearchResult();
        return $searchResult;
    } else {
        return false;
    }
}

Im not getting any product collection returned?
where am i wrong?


texts:
I have a strange problem, which gives me the feeling i missed some concept:

In an observer triggered via event dispatch <catalog_product_collection_load_before>
i fetch the collection and do a join:

        $select->joinLeft(
            array('partner_stock' => Mage::getSingleton('core/resource')->getTableName('xxx_partner_stock')),
            "`e`.`sku`=`partner_stock`.`sku` AND `partner_stock`.`customer_id`={$partnerId}",
            array('stock_id'=>'stock_id')
        );

In a later observer listening to <catalog_product_collection_load_after> i fetch the select and its missing the join. Any clou why?


texts: Using AJAX for displaying Random Products on Home Page

texts: Can any one give me an example of Displaying Random Products on homepage using AJAX in Magento 2.3


texts: Magento 2: Capturing Coupon Code Application / Cancelling

texts:
I cannot find a useful event for capturing when a coupon has been applied / cancelled and then updating the my cached version of the cart details.

The events I've tried:

// seems to only update when you add/remove a product
checkout_cart_save_after

// seems to only be useful when trying to discard a coupon before it is processed
salesrule_validator_process

// again, only seems to be for actual cart items, not coupons
checkout_cart_update_items_after

Any pointers would be very useful.


texts: Magento 2: How to Add Additional Countries?

texts:
Apart from Magento Default Country list. I have below Countries which needs to be added.

MINE                     MAGENTO MAPPED
-------------------------------------------
Antigua and Barbuda => Antigua & Barbuda
Brunei Darussalam => Brunei
Cote D'Ivoire => Côte d’Ivoire
Hong Kong => Hong Kong SAR China
Iran (Islamic Republic of) => Iran
Macau => Macau SAR China
Myanmar => Myanmar (Burma)
Russian Federation => Russia
Saint Kitts and Nevis => St. Kitts & Nevis
Saint Lucia => St. Lucia
Slovakia (Slovak Republic) => Slovakia
Viet Nam => Vietnam
Virgin Islands (U.S.) => U.S. Virgin Islands

------------------- PENDING TO MAP ----------------------

Korea => PENDING North Korea, South Korea?
Lao Democratic Republic => PENDING Laos/Central African Republic/Dominican Republic?
Puerto Rico => PENDING

How to define that Code or get Standard Code for Countries from http://www.nationsonline.org/oneworld/country_code_list.htm?

So once it's added it will be displayed through Country DropDown.

May be Need to work with below tables

directory_country
directory_country_region
directory_country_region_name

Or

vendor\magento\zendframework1\library\Zend\Locale\Data\en.xml file


texts: Dashboard graph showing orders, but no amount

texts:
We just migrated our webshop to a new domain.

Now, whenever an order is placed, the order does show up in the admin dashboard graph as order, but doesn't show op in the amounts tab. Also revenue is displayed as 0.

The transaction is not canceled, we have received the money and the order status was processing and is now shipped. Before the migration, everything worked like a charm.

We also upgraded from magento 1.9.2.0 to 1.9.2.4.

I tried the aggregated data setting, it is set to no. The google api is correct in Graph.php. I also tried the getChartUrl from false to true, but no luck there.

Anybody have any suggestions?


texts: How to make Coupon Code Default open and remove required filed in Magento 2?

texts:
The thing i want with this in Magento 2:

I want to make coupon code default open when user come on that screen.
Remove its required validation .
Like :

How to do that Any Help is Appreciated.


texts: How to link existing modman modules to magento project through modman

texts:
My project contains .modman folder, which has more than 30 modules.

So, I installed modman and tried to link each module using

modman link .modman/**** --force

its giving a message

  "A module named '****' has already been checked out",

But nothing is actually linked.

Any help with this would be appreciated.


texts:
we want to remove free shipping method from custom shipping module magento2.

Any idea regarding above will be much appreciated.


texts: Loading custom phtml file in static block

texts:
I have a static block that I want to load a .phtml file from.

I used this code after looking through stackoverflow,

{{block class="Magento\Framework\View\Element\Template" name="custom_page" template="Magento_Theme::html/custompage.phtml"}}

My .phtml file is at,

/home/website/magento2.com/app/design/frontend/Smartwave/porto_child/Magento_Theme/templates/html/custompage.phtml

I get a blank white page with no errors in log file, what did I do wrong?


texts: Magento 2 Rest Ajax call appends weird number as parameter

texts:
I implemented a custom Rest Api in my module. Until now everythhing works fine. Jquery Ajax is used to call the api. The JS Code is below:

                $("#p").click(function(){
                      $.ajax({
                         url: "http://127.0.0.1/rest/V1/ajax/l/-100/b/0-300/fo/a/fa/a/p/100-/cat/a",
                         type: "GET",
                         beforeSend: function(xhr){
                               xhr.setRequestHeader('content-type', 'application/json');
                               xhr.setRequestHeader('cache-control', 'no-cache');
                                                                                },
                         success: function(response) { $('#b').html(response);}
                      });
                }); //close onclick

When inspecting the Ajax call in Browser, the following is shown:

Everything works fine and I receive the correct response. But I am asking myself why this number (see red arrow) is automatically appended in the request?

How can I prevent that behavior ?