texts: How to add different prices for the same product?

texts:
I want to add different prices for the same product, based on the size of apparrel the customer selects.

For example:

Kids sizes £10

Adults sizes £15

How do I do this? As all I am able to do currently is add a fixed price for each size.


texts: Magento 2: Load multiple categories by category ids

texts:
Hi i want to load multiple categories in Magento 2.3.
 but it only fetch 1st category of a subcategory, not rest of category.

$categories = $_objectManager->create('Magento\Catalog\Model\Category')->load(3,4,5);


texts: How to get how many times a product is sold?

texts: I need to get the number of times a certain product is sold or ordered. I should show this in product page


texts: How to add My Compare List link to Top Links?

texts:
I'm trying to add My Compare List link to top links near the My Wishlist.
Where is its' template?
I looked lots of files but i couldnt find it.
Thanks.


texts: Suddenly stop working elastic search, Error message : Couldn't connect to host, Elasticsearch down?

texts:
I am stuck on this issue my code suddenly stops working not able to find the root cause of any idea regarding this. Earlier it was working fine. Kindly help. I have checked the all configuration are correct.
Fatal error:  Uncaught Elastica\Exception\Connection\HttpException: Couldn't connect to host, Elasticsearch down? in /data/docroot/magento/vendor/ruflin/elastica/lib/Elastica/Transport/Http.php:186
Stack trace:
#0 /data/docroot/magento/vendor/ruflin/elastica/lib/Elastica/Request.php(171): Elastica\Transport\Http->exec(Object(Elastica\Request), Array)
#1 /data/docroot/magento/vendor/ruflin/elastica/lib/Elastica/Client.php(662): Elastica\Request->send()
#2 /data/docroot/magento/vendor/ruflin/elastica/lib/Elastica/Search.php(461): Elastica\Client->request('elasticdata/...', 'GET', Array, Array)
#3 /data/docroot/magento/fetch_all_data.php(142): Elastica\Search->search(Object(Elastica\Query))
#4 {main}
  thrown in /data/docroot/magento/vendor/ruflin/elastica/lib/Elastica/Transport/Http.php on line 186


texts: Magento CE 2.2.X Configurable product with 1 Attribute -Error: Display Out of Stock Products

texts:
Steps to reproduce

Install Magento 2.2.X CE Sample Data
Admin > Stores > Configuration > Catalog > Inventory > Stock Options > Display Out of Stock Products = Yes.

CLI php bin/magento indexer:reindex

Admin > Products > Catalog > Create configurable product with 1 attribute. Set either Quantity = 0 or Stock Status = Out of Stock.

Expected result

Frontend product should display with all Simple products part of Configurable product and should display with class disabled (red strike through) for out of stock .

Actual result

Frontend product not displayed all.


texts: Export and Import configurable product price changes

texts:
I couldn't anywhere find a solution to my question, so I decided to post here.
I have added a configureable product to my store with 2 attributes (dimensions and material) both have different sku's for each combination and different prices.
Now I managed to export the data, edited the prices, uploaded it again, but when viewing the "configurable product" in configuration and shop frontend still the old prices show up.
Does anybody know what I might have overlooked?!
Thanks in advance!
Michael


texts: Undestand the name of the block to rewrite

texts:
Using Magento, I'd like to add a new column in the Product details, inside the tab "Related Products" and "Up-sells" (Catalogue > Manage Products > Select a Product > Related Products).

How can I find the right name of the block to extend or rewrite?

(Magento CE 1.9)


texts:
I am trying to override

Magento_Braintree/js/view/payment/method-renderer/cc-form

But i am not getting any progress. I have tried
map

'Magento_Braintree/js/view/payment/method-renderer/cc-form': 'module_name/js/view/payment/method-renderer/cc-form-mixin'

mixins:

'Magento_Braintree/js/view/payment/method-renderer/cc-form': {
'module_name/js/view/payment/method-renderer/cc-form-mixin': true

Anyone know how to solve this any help or advice


texts: Magento cache showing old product images on page zoom

texts:
So I've updated a product image, I've cleared the image cache, css/js cache, and the magento caches. When you zoom in and out on the page, the browser functionality, the images change back to the old images and stays as this old image until you refresh again.

I've also cleared the browser caches to make sure it's not the browser, and tried a browser that has never visited the page, incognito etc.

I've checked the product and the new images are set on the default and store level.

How can I get Magento to clear this cache properly?


texts: Display bestsellers products on products catalog page

texts:
I am displaying bestsellers on a blank layout right now, but I want to use the same layout and template as in product catalog, to be able to switch between grid and layout mode, apply filters, etc.
Is there anyting I can do to display it this way?

Fetching bestsellers:

public function getBestsellersCollection() {
    $productCount = 5;
    $storeId = Mage::app()->getStore()->getId();

    $productsBestSellerMens = Mage::getResourceModel('reports/product_collection')
            ->addOrderedQty()
            ->addAttributeToSelect('*')
            ->setStoreId($storeId)
            ->setOrder('ordered_qty', 'desc');

    return $productsBestSellerMens->getData();
}

config.xml

<?xml version="1.0"?>
<config>
<modules>
    <Dexm_Best>
        <version>1.0.0</version>
    </Dexm_Best>
</modules>
<global>
    <helpers>
        <best>
            <class>Dexm_Best_Helper</class>
        </best>
    </helpers>
</global>
<frontend>
    <routers>
        <best>
            <use>standard</use>
            <args>
                <module>Dexm_Best</module>
                <frontName>bestsellers</frontName>
            </args>
        </best>
    </routers>
    <layout>
    <updates>
        <best>
            <file>dexm_best.xml</file>
        </best>
    </updates>
</layout>
</frontend>
</config>

dexm_best.xml

<best_index_index>
    <reference name="content">
        <block type="core/template" name="best" template="dexm/best/bestsellers.phtml" />
    </reference>
</best_index_index>

bestsellers.phtml

$product = Mage::helper('best')->getBestsellersCollection();


texts: Can't view mega menu after apply product filter in Magento 1.9

texts: I have a problem with page view, when I apply a filter (i.e : Price, Colours ...etc) the result page begin from footer if I have only a few products, but when I have many results the view begin from middle of the page (I need to scroll up to view the first product).


texts: How to add a Customer Attribute in a custom module using declarative schema in Magento 2.3?

texts: How to add an Attribute for a Customer Entity in a custom module using declarative schema in Magento 2.3?


texts: Magento 1.9.2 - Prices are updated in the back end but not in the front end after import

texts:
I made an import with the eMagicOne program using the Bridge connection to update all site prices. In the backend the prices are all up to date, but in the front end I keep seeing the old prices. This type of problem occurs only for two stores of the site. Only in one store I see in the front end the new prices.

I've really tried everything. I did the reindex, cleaning the cache etc ... but it did not work. What could be the problem?

Thanks for every help


texts: Magento multilang - search results of all languages

texts:
Whenever i use the search function (not advanced search) i only get store specific answers.
So if a product is called Civic Carbon Hood in English and in Dutch Civic Carbon Motorkap I will get a problem when I search on the Dutch storeview for Civic Carbon Hood..

While it is the same product it won't find a hit. Now i found somewhere that it is related to the function addStoreFilter. So i tried to disable it everywhere i could find it relatable to the search or product function. Also commented the setStore function out just in case. Sadly enough this wasn't the solution.

My question is: where do i need to search or what do i need to modify etc.. Because going nuts over here searching for the resolution...

Thanks in advance!


texts: How to print different tax rates in magento 2.1.6

texts: I need to print different tax rates of Product Tax Class in Order Summary,order confirmation mail ,invoice..etc For example there are two type of tax rates in India Igst,Sgst .I need to print both separately and the total tax.


texts: Magento 2 Get Special Price of Product with a specific Customer Group

texts:
I am trying to get access to the special product prices using PHP. These have already been set to the products themselves under the Advanced Pricing section. My end goal is to access these products' special prices and then also set some specific customer group prices of my own.

From what I am aware there are two points to access this: The Product Repository and Magento 2's REST Endpoints. I would prefer to access it through the product repository. Any help appreciated.


texts: Select option in configuration not store in database

texts:
I am following the answer to creating a table with dropdown in Store>Configuration.

Its looks good but not storing my selected dropdown value in core_config_data table.

currently its storing null array, if I remove dropdown and add text field than its working completely fine and also store data in database, so I think I made some mistake for creating dropdown.

Here is my code:

File: system.xml

    <field id="template" translate="label" sortOrder="5" showInDefault="1" showInWebsite="1" showInStore="1">
           <label>Select Template</label>
           <frontend_model>Vendor\Module\Block\Adminhtml\Form\Field\Template</frontend_model>
           <backend_model>Magento\Config\Model\Config\Backend\Serialized\ArraySerialized</backend_model>
    </field>

File: Template.php

class Template extends AbstractFieldArray
{
  protected $_itemRenderer;

  protected function _prepareToRender()
  {
    $this->addColumn(
        'deliverydays',
        [
            'label' => __('Delivery Days'),
            'readonly'=>'readonly',
            'renderer' => $this->_getRenderer()
        ]
    );
    $this->_addAfter = false;
    $this->_addButtonLabel = __('Add More');
  }

  protected function _getRenderer()
  {
    $this->_itemRenderer = $this->getLayout()->createBlock(
        \Vendor\Module\Block\Adminhtml\Form\Field\Options::class, '',
        array('is_render_to_js_template' => true)
    );
    return $this->_itemRenderer;
  }

File: Options.php

class Options extends Select
{
/**
 * @var \Magento\Eav\Model\Config
 */
protected $_eavConfig;

public function __construct(Context $context,
                            \Magento\Eav\Model\Config $eavConfig,
                            array $data = [])
{
    parent::__construct($context, $data);
    $this->_eavConfig = $eavConfig;
}

public function _toHtml()
{
    $html = '<select>';
            foreach ($this->attributeOptions() as $column):
    $html .= '<option value="'.$column.'">'.$column.'</option>';
            endforeach;
    $html .= '</select>';
    return $html;
}

public function setInputName($value)
{
    return $this->setName($value);
}

  public function attributeOptions(){
    $attributeCode = "delivery_days";
    $attribute = $this->_eavConfig->getAttribute('catalog_product', $attributeCode);
    $options = $attribute->getSource()->getAllOptions();
    $attrValues = [];
    foreach ($options as $option) {
        if ($option['value'] > 0) {
            $attrValues[] = $option['label']; //->getText(); //use '->getText' if attribute is system generated
        }
    }
    return $attrValues;
  }
}


texts: Compare() link to be placed in dropdown menu in magento 2.3

texts:
I want to place the Compare link inside the dropdown below Wishlist in header links as shown here

OR https://prnt.sc/os1u0o.

Can any one tell me how to do that ?


texts:
My server TTFB wait time is 14 seconds ,
Total loading time is 24.5 seocnds
I have attached my waterfall for GT metrix:
How can I deal with it ??
I am done with following :

I have minified css and JS
Enabled Flat category
Production mode is enabled
Cloudfront images are enabled
Upgraded Magento version
Advance JS bundling

The whole store is slow but the product page is extremely slow.
Shall I go for Full page cache warmer extension?
Should I configure Varnish & redis ?
I am also done with advance JS bundling  It reduces only 4 to 5 seconds
Kindly suggest solutions!!!!


texts: Magento 2 : Update Flatrate Price in Summary Block Based on Zip Code

texts:
I want to overwrite summary block on cart page. I'm fetching dynamic values from an API, based on zip code user have provided. I need to

fetch input value that user entered in zip code box
passing this value to the API call
getting result and displayed near shipping method name using ajax.

Here I'm trying to integrate dynamic value with flat rate shipping method. The possible problem that may appear is that dynamic value will be inserted into core_config_data table if a user tried to add any product to cart. When any other user gets into cart page, shipping method price that displayed will be same price that previous user had, which is fetched from DB (core_config_data). Any solution for this

To overwrite summary block
To resolve possible issue.

I followed this method to overwrite flat rate shipping method.


texts: Add column in sales order grid table in magento2

texts:
I have added two columns in sales order grid table. But only one value is showing in that two column i don't know how to return multiple values in column, below code is prepareDataSource function inside that UI folder.

   public function prepareDataSource(array $dataSource)
{
    if (isset($dataSource['data']['items'])) {
        foreach ($dataSource['data']['items'] as & $item) {
            $order  = $this->_orderRepository->get($item["entity_id"]);
            $school_name = $order->getData('school_name');
            $seller_id = $order->getData('seller_id');
            if(empty($school_name))
            {
                $item[$this->getData('name')] = 'Default';
            }
            else
            {
                $item[$this->getData('name')] = $school_name;
            }
        }
    }
    return $dataSource;
}

I want to return that $seller_id please tell me how to return.


texts: Shipping modules does not update rate on zip code changes in guest-checkout page Magento 2 production mode

texts:
Preconditions

Magento 2.0.4 install
Cart page and checkout page

Steps to reproduce:

1. Put any product inside your cart
2. Open cart page or checkout page
3. input zipCode to calculate tax for shipping

Expected result
Module should update the rate for shipping each time I change the zip code.

Actual result:
Nothing happens, the value doesn't appear.

It's working perfectly on developer mode, but not in production mode when we update or change zip-code it will do nothing. not even going to validation, no errors.

In developer mode it does validation and sends AJAX request on this url , and everything goes fine.
/rest/default/V1/guest-carts/xxxxxxxxxxxxxxxx/estimate-shipping-methods

Any help will thankful of you.

  Update: now its work on production mode too if I turn off this things
  from admin->stores->configuration->advance->developer Merge JavaScript
  Files No Enable Javascript Bundling  No Minify JavaScript Files NO

Any help, advice?


texts:
it's possible to reset invoice id by new year?

For instance: 1,2,3,4 -> 2014 and then 1,2,3,4 -> 2015.

The field increment_id of sales_flat_invoice seem to avoid this possibility.


texts: Change configurable product price selecting a swatch

texts:
Good morning,
i'm working on a magento 2.2.5 store and i have a question about configurable products configurations.
I have some products where the price is different betweent the configurations.
Example:
Configurable product: Hat
Red hat costs 10$; Blue hat costs 15$.

If i click on the blue visual swatch  the product image updates, but the product price is always the same (the lowest).
If i add the blue product in the cart the price is the correct one.
My question is that: it is possible to update the price is the product page clicking on the visual swatch? it is a bug of magento or maybe of my theme?

Thanks


texts:
I have been overriding the function saveOrderAction in the OnepageController.php (/app/code/core/Mage/Checkout/controllers) with my custom code.

I have implemented the logic for this successfully. I believe at this point at the start of the function as the order hasn't been completed there is no order ID. Instead I have access to the 'quote ID'.

What I need to do now is find out where the Order ID is generated for the order. My first question is which file/function is best to override for when the Order ID is created?

My second question is, is there a way to link the quote ID to the Order ID which is generated?

Essentially my aim is to get the order ID of the currently ordered items so I can do further custom processing.

My observer code is through this path: /local/James/Aftercheckout

config.xml - /local/James/Aftercheckout/etc

Observer.php - /local/James/Aftercheckout/Model

Contents of config.xml:

<?xml version="1.0"?>
<config>
<modules>

    <James_Aftercheckout>

        <version>0.1.0</version>

    </James_Aftercheckout>

    </modules>
<global>
    <events>
        <sales_model_service_quote_submit_before>
            <observers>
                <james_aftercheckout_observer>
                    <type>singleton</type>
                    <class>James_Aftercheckout_Model_Observer</class>
                    <method>test</method>
                </james_aftercheckout_observer>
            </observers>
        </sales_model_service_quote_submit_before>
    </events>
</global>

Code for Observer.php :

class James_Aftercheckout_Model_Observer
{

public function test($observer)
{
    $quote = $observer->getEvent()->getQuote();
    $incrementId = $quote->getReservedOrderId();

    $to = "myemail@gmail.com";
    $subject = "Test mail";
    $message = "Hello! This is a simple email message! .".$incrementId;
    $from = "randomemail@example.com";
    $headers = "From:" . $from;
    mail($to,$subject,$message,$headers);
}
}


texts: How can I capture funds using a Saved credit card

texts:
I need to accept pre-orders on my Magento site however the orders will remain on hold for longer than 30 days which means that I cannot pre-authorize the credit cards because the pre-authorization would expire.

I understand that I can save credit cards on my Magento site which will allow us to bill the credit card when we need to.

The problem is that when I do save credit cards, I'm not sure how to bill the credit cards (using PayPal) without going order by order and manually copy/pasting the thousands of credit card numbers one-by-one into PayPal Manager. Does anyone have any ideas how I can accomplish what I need to?

PS: After the pre-orders are done, I would plan to change the encryption key so that the data becomes unreadable.


texts: Media Upload Issue - Session "getCurrentPath()" is empty

texts:
I'm unable to upload media gallery images in my Magento 2.3.4 website. It works on my local ubuntu setup but fails on the development/staging server. The upload fails with the error message
A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later.

Here is the related log entry
PHP Fatal error:  Uncaught TypeError: strpos() expects parameter 1 to be string, null given in <website_absolute_path>/vendor/magento/framework/App/Filesystem/DirectoryResolver.php:63
Stack trace:
#0 <website_absolute_path>/vendor/magento/framework/App/Filesystem/DirectoryResolver.php(63): strpos(NULL, '/home/websiteuser...')
#1 <website_absolute_path>/vendor/magento/module-cms/Controller/Adminhtml/Wysiwyg/Images/Upload.php(59): Magento\Framework\App\Filesystem\DirectoryResolver->validatePath(NULL, 'media')
#2 <website_absolute_path>/vendor/magento/framework/App/Action/Action.php(108):  Magento\Cms\Controller\Adminhtml\Wysiwyg\Images\Upload->execute()
...

So the first argument to DirectoryResolver->validatePath($path, $directoryConfig = DirectoryList::MEDIA) should be the the absolute path to pub/media directory but in my case it is empty.
The $path variable is created by the line of code
$path = $this->getStorage()->getSession()->getCurrentPath();

present just above the validatePath() call. So $path is supposed to be in the session. The session object holds all its data in a Magento\Framework\Session\Storage object which gets initialized by the following line in Magento\Framework\Session\SessionManager
$this->storage->init(isset($_SESSION) ? $_SESSION : []);

Checking the $_SESSION, the "currentPath" should be present under the following array structure
$_SESSION
    adminhtml
        _form_key => 3jowEx2Npr2QbRA6
        locale => en_US
        current_path => <website_absolute_path>/pub/media/

which is so on my local development environment but the current_path key is missing on the staging server which looks like the root of this issue.
Question: How does Magento populate the $_SESSION superglobal and how do I resolve this issue?
The website is in development mode with empty Base URL for User Media Files and Secure Base URL for User Media Files configuration values
Update 1
The above session observations were taken by debugging the media image upload AJAX request that gets made automatically to /admin/cms/wysiwyg_images/upload/key/<some_key>/?isAjax=true when a user selects an image to upload.
Update 2
The "Insert File..." media browser/select popup doesn't show the images that were already uploaded on my development machine before a copy was uploaded to staging server. It is just empty with folder tree structure on left and a Upload Images [browse...] on its right.
Update 3
Copied the site from the staging server to the same server including the database and files, cleared caches (no di:compile or static content deploy was performed) and the image upload is working fine on the copy.
so what is going on???


texts: Magento Transaction Emails have stopped sending on BACS and Paypal orders, but work on Credit Card Orders

texts:
Had a magento installation for about 10 months now, originally installed as 1.8 and been using it fine for the whole period. In december I upgraded to 1.9.1 and since this time, we have only been receiving transaction emails for orders that are paid via Credit Card. BACS and PayPal (our other payment methods) are not generating the emails.

I downloaded the exception.log and there have been no errors recorded.

I have googled and saw here  that all emails in 1.9.1 have been made to use Cron. So I went to try and run the cron.php and it didn't bring any output, so I modified the try/catch to echo results to help me figure out where it was running, and the file doesn't seem to want to run and just spins and produces a blank page. So i'm lead to believe it's something to do with this.

cPanel is set with the following cron: */5   *   *   *   *   wget -O /dev/null -q http://www.domain-name.com/cron.php and this is also the location I am going too to get the blank output from cron.php

See below the contents of the cron.php file.

try {
if (stripos(PHP_OS, 'win') === false) {
    $options = getopt('m::');
    if (isset($options['m'])) {
        if ($options['m'] == 'always') {
            $cronMode = 'always';
        } elseif ($options['m'] == 'default') {
            $cronMode = 'default';
        } else {
            Mage::throwException('Unrecognized cron mode was defined');
        }
        echo "Cron Run
";
    } else if (!$isShellDisabled) {
        $fileName = basename(__FILE__);
        $baseDir = dirname(__FILE__);
        shell_exec("/bin/sh $baseDir/cron.sh $fileName -mdefault 1 > /dev/null 2>&1 &");
        shell_exec("/bin/sh $baseDir/cron.sh $fileName -malways 1 > /dev/null 2>&1 &");
        echo "Cron Run by Shell
";
        exit;
    }
}

Mage::getConfig()->init()->loadEventObservers('crontab');
Mage::app()->addEventArea('crontab');
if ($isShellDisabled) {
    Mage::dispatchEvent('always');
    Mage::dispatchEvent('default');
} else {
    Mage::dispatchEvent($cronMode);
}
echo "CronTab Run
";
} catch (Exception $e) {
Mage::printException($e);
exit(1);
}

I'm unsure how I can expand on my testing so that I can at least put this section of debugging to rest.

If you have any ideas why the site won't correctly send on just some payment types, then I can fix that directly and worry about cron when it's causing issues. If the above is the issue then any help on how to make it work again would be great.

Thanks for your help.


texts: Magento 2.3 : How to create product attribute via declarative schema?

texts:
How to create a product attribute in Magento 2.3 via declarative schema. I have tried below code but the input element is not visible on the form.

<?php

namespace Rokanthemes\Updates\Setup\Patch\Data;

use Magento\Framework\Setup\Patch\DataPatchInterface;
use Magento\Framework\Setup\Patch\PatchVersionInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Customer\Model\Customer;
use Magento\Customer\Setup\CustomerSetupFactory;
use Magento\Eav\Model\Entity\Attribute\SetFactory as AttributeSetFactory;
use Magento\Framework\DB\Ddl\Table;

class AddAttributes implements DataPatchInterface
{
    protected $_moduleDataSetup;
    protected $_customerSetupFactory;
    protected $_attributeSetFactory;

    public function __construct(
        ModuleDataSetupInterface $moduleDataSetup,
        CustomerSetupFactory $customerSetupFactory,
        AttributeSetFactory $attributeSetFactory
    )
    {
        $this->_moduleDataSetup = $moduleDataSetup;
        $this->_customerSetupFactory = $customerSetupFactory;
        $this->_attributeSetFactory = $attributeSetFactory;
    }

    public function apply()
    {
        $customerSetup = $this->_customerSetupFactory->create(['setup' => $this->_moduleDataSetup]);

        $customerEntity = $customerSetup->getEavConfig()->getEntityType(Customer::ENTITY);
        $attributeSetId = $customerEntity->getDefaultAttributeSetId();

        $attributeSet = $this->_attributeSetFactory->create();
        $attributeSet->getDefaultGroupId($attributeSetId);

        $customerSetup->addAttribute(Customer::ENTITY, 'news_from_date', array(
            'type' => Table::TYPE_DATE,
            'label' => 'New from date',
            'input' => 'date',
            'required' => 1,
            'type' => 'static',
            'visible' => true
        ));
    }

    public function getAliases()
    {
        return [];
    }

    public static function getDependencies()
    {
        return [

        ];
    }
}

Thanks for the help.


texts: How can I get Visual Swatch option imange in magento 2 product view page

texts:
I have attribute option Id but I can't get the image of swatch.
Is there any way of getting image.


texts:
i have this error when i click on in the user panel on My Downloadable Products

I hope anyone can help me

2016-12-13T22:33:21+00:00 ERR (3): Warning: htmlspecialchars() expects parameter 1 to be string, object given  in /home/blueb/public_html/app/code/core/Mage/Core/Helper/Abstract.php on line 315

In Abstract.php is this line on 315

/**
     * Retrieve layout object
     *
     * @return Mage_Core_Model_Layout
     */
    public function getLayout()
    {
        return $this->_layout;
    }


texts: How to display customer's email with the customer ID in Magento 2

texts:
I made a product attribute named "Seller ID" which I would give a sample value of "2". How can I display a customer's email and name which has a customer id of "2" or whatever numerical value is in Seller ID attribute?

I'm pretty new to Magento 2 and it would help if you can explain a little.

Thank you!


texts: Magento for an ecommerce marketplace - use Magento community and build on it or use Magento Enterprise

texts:
I need to launch an e-commerce marketplace using Magento. However, there are some issues that come to mind: -
Our business model is C2B2C. A Magento partner suggested Magento Commerce but we found it to be expensive because of the licensing fee and the fact that it is based on the total revenue going through the store. As a marketplace, the margins made are comparatively very less when compared to the total revenue. Does Magento offer a special licensing fee to marketplaces allowing them to pay based on commission rather than the total revenue?
Would it be possible to launch with Magento Community and customize it to fill in any gaps with the help of another company that specialises in Magento?
How feasible would a micro-services architecture be to develop a marketplace which is scalable and then later on as we grow add more functionalities?
Appreciate any help from anyone. Thank you so much!


texts:
I've been trying to edit my backend, but without any results, does anyone know how, step by step?
I've already try How to extend backend template files in Magento 2

Maybe I'm doing something wrong, but please any help would do.
Thanks!

PS. I'm looking for editing styles, BTW.


texts: Cant's add custom product attribute for sorting

texts:
I'm trying to add a custom product attribute called popularity a decimal so I can use it for sorting products on the catalog pages.

I've created a module for this and while I can see the module is installed in System > Config > Advanced their is no record of the table in the core_resource table.

I have tried clearing the cache & re-indexing.

app/etc/modules/Namespace_PopularityAttribute.xml

<?xml version="1.0"?>
<config>
  <modules>
    <Namespace_PopularityAttribute>
      <active>true</active>
      <codePool>local</codePool>
      <version>0.1.0</version>
    </Namespace_PopularityAttribute>
  </modules>
</config>

app/code/local/Namespace/PopularityAttribute/etc/config.xml

<?xml version="1.0"?>
<config>
  <modules>
    <Namespace_PopularityAttribute>
      <version>0.1.0</version>
    </Namespace_PopularityAttribute>
  </modules>
  <global>
    <helpers>
      <popularityattribute>
        <class>Namespace_PopularityAttribute_Helper</class>
      </popularityattribute>
      <resources>
        <popularityattribute_setup>
          <setup>
            <module>PopularityAttribute</module>
            <class>PopularityAttribute_Model_Resource_Eav_Mysql4_Setup</class>
          </setup>
          <connection>
            <use>core_setup</use>
          </connection>
        </popularityattribute_setup>
        <popularityattribute_write>
          <connection>
            <use>core_write</use>
          </connection>
        </popularityattribute_write>
        <popularityattribute_read>
          <connection>
            <use>core_read</use>
          </connection>
        </popularityattribute_read>
      </resources>
    </helpers>
  </global>
</config>

app/code/local/Namespace/PopularityAttribute/sql/popularityattribute_setup/mysql4-install-0.1.0.php

<?php
$installer = $this;
$installer->startSetup();
$installer->addAttribute('catalog_product', 'popularity', array(
    'group'         => 'Our Custom Group',
    'input'         => 'text',
    'type'          => 'decimal',
    'label'         => 'Popularity',
    'note' => 'Will be used as the default method of sorting products on the category pages in descending order.',
    'default' => true,
    'default_value' => 0,
    'sort_order' => 2,
    'visible'       => false,
    'required'      => false,
    'user_defined' => false,
    'searchable' => false,
    'filterable' => false,
    'comparable'    => false,
    'visible_on_front' => false,
    'visible_in_advanced_search'  => false,
    'is_html_allowed_on_front' => false,
    'global'     => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
    'used_in_product_listing' => true,
));
$installer->endSetup();


texts: CustomerGroupsId always true for cart price rules

texts:
I'm a bit new here in the forum som feel free to slap me on the fingers if I'm dumb.

I want to change the logic in the sales rules engine so it doesn't check the salesrules_customer_id table and instead just skips that filtering.

The reason for this is that the site I'm building is going to use A lot of the same cart price rules. And the less the algorithm checks for the faster the site.

I've been debugging around in:
Magento\SalesRule\Model\ResourceModel

But still I'm not able to find what I'm searching for.

Anyone got any clue how to solves this?


texts: Cannot remove telephone and region/province from billing information on checkout

texts:
I am trying to remove the telephone and state/province field as a required field in my checkout.

I have already successfully removed it from the shipping section, and I tried to remove it the following way:

1.) I have removed the class="required" and the * from the following files

checkout/onepage/shipping.phtml
checkout/onepage/billing.phtml
persistent/checkout/onepage/billing.phtml

Like I mentioned above the shipping one works fine but the billing not.
When template hints are on it does not mention a different template.

2.) I have copied the Abstract.php core class

app/code/core/Mage/Customer/Model/Address/Abstract.php

to

app/code/local/Mage/Customer/Model/Address/Abstract.php

And removed the validation there.

3.) I have set the field in the database to not required.

However in the billing section when I checkout, the telephone field and province field are still required and the "*" is also still coming up.

Am I missing something obvious?


texts: How to move the Search Bar/Div into the Navigation CustomMenu area?

texts:
So Far I've done the following;

In catalogsearch.xml I have the following code:

<reference name="topMenu">
            <block type="core/template" name="top.search" as="topSearch" template="catalogsearch/form.mini.phtml"/>
        </reference>

then in custommenu/top.phtml I have the following code:

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

The top.html code used to be in header.phtml - so I just copied it.

And the reference code  used to say reference name="header" so I just changed it to topMenu, but it doesn't seem  to work!  Am I missing something?

I know that the top.phtml file is correct because if I type in "WHERE IS THIS TEXT" it appears inside the menu area where I want the search bar to go.

However, I'm not sure I am referencing it correctly -  If I reference Top (it displays the search above the menu) - if I reference top.menu (it displays it below the menu).   So I thought It would be topMenu - but it shows nothing.

Could I be referencing it wrong?  Is it reference:  nav-container, or top-menu, or customMenu or something else?  Any help would be greatly appreciated.


texts:
It's my understanding that Magento's @magento/venia-concept package is a PWA template project.  You can use Magento's PWA template projects in an invocation of the  buildpack command
buildpack create-project /path/to/a/folder \
        --template "venia-concept"\
        --name "your-project"\
        --author "Alan Storm <astorm@alanstorm.com>"\
        --backend-url "https://master-7rqtwti-mfwmkrjfqvbjk.us-4.magentosite.cloud/"\
        --braintree-token "san...qzk"
        --npm-client "npm"\
        --no-install

to setup a PWA system.
My Question: Are there other open source PWA Template projects, or is venia-concept the only one?


texts:
How can I get the Admin attribute label as shown in the pics?
I can get the frontend store label for each store view in this way:
$attribute = $_item->getResource()->getAttribute('format');
$attr_value = $attribute->getFrontend()->getValue($_item);

but I don't know how I can get the Admin label. Any solutions?


texts: How to set custom value in default Email template Magento 2

texts:
I declared a custom variable to New customer Email template,

{{var myvar1}}

I am assigning the value to that variable from my observer,

    <?php
    namespace test\test\Observer;

    use Magento\Framework\Event\ObserverInterface;

    class Customersubmit implements ObserverInterface
    {
        public function execute(\Magento\Framework\Event\Observer $observer)
        {
            $customer = $observer->getEvent()->getCustomer();
            $customerId = $customer->getId();
            $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
            $transport = $objectManager->create('Magento\Framework\Mail\Template\TransportBuilder');

            if($customerId){
                $templateVars = array( 'myvar1' =>  'testing data' );
                $transport->setTemplateVars($templateVars);
            }
        }
    }

But I couldn't retrieve this value in my email . Could anyone say where I am wrong


texts: how to check validation passed before running script

texts:
I have a small script that runs when a customer presses add to cart that moves to the top of the page to ensure that they see the success message and that the item has been added to their cart.  However, if there is a problem with a selection on a complex product and it fails validation there is a bounce effect as the validation script tries to move the page to the validation error and my script tries to move to the top of the page.

Here is my script (which is in my default.js file):

function animateToTop(e) {
    e.preventDefault();
    var scrollToTop = window.setInterval(function() {
        var pos = window.pageYOffset;
        if ( pos > 0 ) {
            window.scrollTo( 0, pos - 20 );
        } else {
            window.clearInterval( scrollToTop );
        }
    }, 24);
}

Here is the function call in the addtocart.phtml file:

<button class="btn1 btn1-atc" type="button" title="<?php echo $buttonTitle ?>" onclick="productAddToCartForm.submit(this); animateToTop(event)"><?php echo $buttonTitle ?></button>

How can I add a check that validation has been passed before running this?


texts:
I'm using magento 2 and I'm trying to add a content slider on the about us page ,and to do that I need to include the js library , I've tried to do that by adding this

 <reference name="head">
   <action method="addJs">
     <script>library.js</script>
   </action>
 </reference>

to design tab of my page , but still doesn't work..


texts: How to change Cart to only show #of Products & Price?

texts:
http://www.statis-online.com

The cart in Header is cart_sidebar.
It has been moved to Header-Right.

I would like to RESIZE & CUSTOMIZE this to only show Price / Qty of products.
Right now, if a product is added to cart, it will show recently added products as well.

What is the simplest way? Or if I need to change from cart_sidebar to something else, please provide instructions.

All contributions are appreciated!


texts:
When you save your multiple Model Object object then I want to provide Transaction. How can I achieve in magento?

Any one Please Guide Me?


texts: How to add multi-select field in magento2 ui form

texts:
I have created a custom module in magento2. And created ui component form to save title and sort_order value, now I want to add brands as multi-select field in my module's form.

How to add a multi-select field for brands attribute options?


texts: Set all categories to use Config Settings for 'Default Product Listing Sort By' option via SQL

texts:
I want to set all of my Magento 2 categories to 'Use Config Settings' for the 'Default Product Listing Sort By' within the Category Display Settings.
I don't want to do this manually as there are thousands of them.
What SQL command do I need to run to achieve this?


texts: Modify Custom Option Percent Functionality to final price in Magento 2.3.4

texts:
I am trying to modify the way Magento 2.3.4 calculates percentage prices in product custom options to use the final price instead of base price so it returns this (base price £30 + options £10 + option 30% = £52)

I have updated updated :--

/app/design/frontend/Designnbuy/Printshop/Magento_Catalog/model/product/type/price.php

$finalPrice += $group->getOptionPrice($quoteItemOption->getValue(), $finalPrice);

and the percentage is added correctly to the cart but not updating on product page?


texts: Magento2: How can update the product price using before plugin

texts:
I want to update the product price using plugin and I tried the afterGetPrice() plugin its working fine in normal case but showing wrong price calculation when catalog price rule applied, I want to apply catalog price rule before the plugin execution.
I tired the below code :

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">
    <type name="Magento\Catalog\Model\Product">
        <plugin name="change_product" type="Vendor\Module\Plugin\Product" sortOrder="1" disabled="false"/>
    </type>
</config>

Product.php

public function afterGetPrice($product, $proceed) : float
    {
        return $proceed+111.55;
    }

I want to apply catalog price rule before the plugin execution.


texts: Bad Request error on integrating u2f with magento2

texts:
I was integrating u2f to magento2. But on calling u2f.register,there is an error code 2,bad request error.

Could you tell me what I am doing wrong.


texts: Magento 2 When I add a configuration, the product disappears from front end

texts:
I am attempting to add configurations for a product, but whenever I add a configuration, it disappears from the front end. When I remove the configuration, the product reappears.

I've also noticed that the Price and Quantity values are grayed out and uneditable, as shown in the image below:


texts: Magento 2 Best way to link images in a template file

texts:
I am building a module which needs to link an image. I have followed several resources on this, but none worked (example).

Module is working fine, but I can't show the image. What goes wrong? Any ideas?


texts: Magento 2 Can this be left blank or set to $0.00 until the field is populated by the data from the simple item?

texts: Magento 2 how do achieve the below functionality for configurable products?


texts: Configurable Product Error on AddToCart: 'Please specify the product's options(s).'

texts:
Magento ver. 1.8.0.0 (CE)

Having a problem when trying to add a product to the cart. I have selected both the colour and size options (as required) and when I hit 'Add to Cart', it just returns the error 'Please specify the product's option(s).'

Please advise.


texts: Order: To get comment field details from DB in magento 2

texts:
In admin panel Sales->Orders section, while viewing the order, It show order information like below

I need to fetch the comment details from core table (sale_order_status_history).and want to show in frontend. Please provide a solution to get comment field details and what are the files needed to achieve this.

For reference the image is below,

I have created Block file but it returns empty page

<?php

namespace XXX\SalesOrder\Block;

use Magento\Framework\View\Element\Template\Context;
use Magento\Framework\View\Element\Template;
use Magento\Sales\Model\OrderFactory as OrderFactory;

class Hello extends Template
{

    protected $orderFactory;

    public function __construct(
    \Magento\Framework\View\Element\Template\Context $context, OrderFactory $orderFactory
    )
    {
        $this->orderFactory = $orderFactory;
        parent::__construct($context);
    }

    public function getCollection()
    {

        $order = $this->orderFactory->create()->load('1');

        $orderCommentHistory = $order->getStatusHistoryCollection();

      echo '<pre>';
      print_r($orderCommentHistory);
    }

}


texts: How to Add Custom field All payment method in magento2 by progmatically?

texts:
Ex-See field Select Country in bydefault..
i will add new field customer group in all payment method.


texts: upgrading magento project from Magento 2.1.12 CE to Magento 2.3.2 CE setup:upgrade doesnt work

texts:
Dear Magento developers,

I am trying to to upgrade Magento 2.1.12 CE To Magento 2.3.2 CE I followed official dev docs instructions https://devdocs.magento.com/guides/v2.3/comp-mgr/cli/cli-upgrade.html until the step :

Update the database schema and data

php bin/magento setup:upgrade

it doesnt seem to work

and it always throws the error message

    Cache cleared successfully
    File system cleanup:
/var/www/magento2/project/generated/code/Composer
    /var/www/magento2/project/generated/code/MSP
    /var/www/magento2/project/generated/code/Magento

/var/www/magento2/project/generated/code/Thirdparty1
/var/www/magento2/project/generated/code/Thirdparty2
/var/www/magento2/project/generated/code/Symfony
The directory '/var/www/magento2/project/generated/metadata/' doesn't exist - skipping cleanup
Updating modules:
Schema creation/updates:
PHP Fatal error:  Uncaught TypeError: Return value of Magento\Framework\Setup\Declaration\Schema\Declaration\SchemaBuilder::processTable() must be an instance of Magento\Framework\Setup\Declaration\Schema\Dto\Table, boolean returned in /var/www/magento2/project/vendor/magento/framework/Setup/Declaration/Schema/Declaration/SchemaBuilder.php:251
Stack trace:
#0 /var/www/magento2/project/vendor/magento/framework/Setup/Declaration/Schema/Declaration/SchemaBuilder.php(148): Magento\Framework\Setup\Declaration\Schema\Declaration\SchemaBuilder->processTable(Object(Magento\Framework\Setup\Declaration\Schema\Dto\Schema), Array)
#1 /var/www/magento2/project/vendor/magento/framework/Setup/Declaration/Schema/SchemaConfig.php(78): Magento\Framework\Setup\Declaration\Schema\Declaration\SchemaBuilder->build(Object(Magento\Framework\Setup\Declaration\Schema\Dto\Schema))
#2 /var/www/magento2/project/setup/src/Magento/Setup/Model/DeclarationInstaller.php(57): Magento\Framework\Setup\Declaration\Schema\SchemaConfig->getDeclarationConfig()
#3 /var/www/ma in /var/www/magento2/project/vendor/magento/framework/Setup/Declaration/Schema/Declaration/SchemaBuilder.php on line 251

by the way if I remove app/etc/env.php I can bypasse this erreur message in web installer wizard but after that the commande still doesnt work.

thanks in advance


texts:
in germany there is a special Tax on coffee: 2.19 EUR per 1000 gram, and 4.78 EUR per 1000 gram for instant coffee.

I'd like to solve this problem by adding a custom tax to magento.
How would I do that?

EDIT:

I need to calculate the additional product tax based on the product weight instead of the product price.

The product weight may change depending on which (or if any) product options are selected. This is a customer requirement and cannot be changed.


texts:
In an extension I have a rewrite for Mage_Sales_Block_Order_Info.

<config>
  <global>
    <blocks>
      <sales>
        <rewrite>
          <order_info>Company_Module_Block_Sales_Order_Info</order_info>
        </rewrite>
      </sales>
    </blocks>
  </global>
</config>

This works as expected, however in the interest of extensibility for module users, I've tried this instead to no avail

<config>
  <global>
    <blocks>
      <company_module>
        <class>Company_Module_Block</class>
      </company_module>
      <sales>
        <rewrite>
          <order_info>company_module/order_info</order_info>
        </rewrite>
      </sales>
    </blocks>
  </global>
</config>

In this case Magento is throwing an Exception

  exception 'Mage_Core_Exception' with message 'Invalid block type:
  company_module/order_info'

My question is twofold

Am I simply declaring this rewrite incorrectly when trying to use the class alias notation?
Is using the class alias notation for a rewrite actually pointless here? My thought is users of the module might use the same override notation I have, then extend my module's Company_Module_Block_Sales_Order_Info class instead of Mage_Block_Sales_Order_Info since Magento is looking for the sales/order_info alias in the first place.


texts: Magento crash with httpd memory full... I clear cookies and cache and it´s solved

texts:
I have a problem with Magento that crashes the site sometimes, and I think that I have found the cause:

1º My normal httpd usage its around 2-3 gb.

2º With my browser, I go to Catalog Price Rules in Magento and then I "Apply and Save" one of the rules.

3º Then, I see that in minutes the httpd its in more than 10gb and increasing...

4º I go to my browser, and I clear cache and cookies of my web.

5º Without touching nothing, the httpd decrease to the normal size of 2-3 gb.

I have a FULL PAGE CACHE and Redis, but I don't know where is the problem and how to solve.
Thanks


texts: Magento 1: How to add captcha on a custom page

texts:
I found an app that adds a captcha to the contact page - it works well.

But it doesn't add it to the other custom forms I've built.

<layout version="0.1.0">

<contacts_index_index translate="label">
    <reference name="content">

        <reference name="contactForm">
            <action method="setTemplate">
                <template>contacts/contactscaptcha.phtml</template>
            </action>
            <block type="core/text_list" name="form.additional.info" >
                <block type="captcha/captcha" name="captcha">
                    <reference name="head">
                        <action method="addJs"><file>mage/captcha.js</file></action>
                    </reference>
                    <action method="setFormId"><formId>contact_us</formId></action>
                    <action method="setImgWidth"><width>230</width></action>
                    <action method="setImgHeight"><width>50</width></action>
                </block>
            </block>
        </reference>

    </reference>
</contacts_index_index>

My thinking was to add something like:

    <formABPOA translate="label">
    <reference name="content">

        <reference name="formABPOA">
            <action method="setTemplate">
                <template>contacts/formABPOA.phtml</template>
            </action>
            <block type="core/text_list" name="form.additional.info" >
                <block type="captcha/captcha" name="captcha">
                    <reference name="head">
                        <action method="addJs"><file>mage/captcha.js</file></action>
                    </reference>
                    <action method="setFormId"><formId>formABPOA</formId></action>
                    <action method="setImgWidth"><width>230</width></action>
                    <action method="setImgHeight"><width>50</width></action>
                </block>
            </block>
        </reference>

    </reference>
</formABPOA>


texts:
I have set cookies in js with bellow code

 getSelectedValuecc: function() {
            jQuery(function () {
            jQuery("#paytm_payment_profile_id").change(function () {
            //alert('select chnage');
            var selectedValue = jQuery(this).val();
            alert("Value: " + selectedValue);
            $.cookie('cookie_name', selectedValue,{ path: 'http://vaibhav.local/complaint/customer/index' });
            var temp = $.cookie('cookie_name');
            alert("cookie - " +temp);
            //jQuery('input[name="payment[method]"]').attr("disabled",true);
           if (selectedValue !=''){
               jQuery("#pay").show();
               jQuery("#address").show();
            }else{
                jQuery("#pay").hide();
                jQuery("#address").hide();
            }
            alert("Value: " + selectedValue);
            if(selectedValue == 'vsquare'){
               jQuery("#address").html("V Square Building 1st Lane, DwarakaNagar,Visakhapatnam-530016,AP.,India").show();
               jQuery("#paytm").click();
               return true;
            }
            if(selectedValue == 'pavanpalace'){
               jQuery("#address").html("A-1,Pavan Palace,near telugu thalli Flyover,Station Road, Dwaraka Nagar,Visakhapatnam-530016,AP.,India").show();
               jQuery("#paytm").click();
               return true;
            }
            return selectedValue;
        });
    });
    },

I want to get this cookies on observer with bellow code

public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $cookieValue = $this->_cookieManager->getCookie(\Iksula\Complaint\Controller\Customer\Index::cookie_name);
        echo($cookieValue);
}

i am getting error Undefined class constant 'cookie_name'


texts: inserting custom block above coupon block in shopping cart

texts:
How do I insert a custom block right above the coupon code field in the shopping cart by just using the layout.xml (without editing the template using getChildHtml()).

I had done it before now i just cant seem to remember the block name..


texts: How to remove the label for the customer prefix option in frontend

texts:
I added the customer prefix option for my frontend, and its working fine. Unfortunately Magento has added a frontend label for this option. How ca I hide/remove this label?

Christian


texts: Database Rollback not working with magento 2.1.9?

texts: I created one test DB backup "test backup", when trying to rollback with SSH it only looks for somecode_db.sql file instead this backup contains the name in it's file. is it magento2.1.9 bug?


texts: Which Price function is called when product is added to cart in magento?

texts:
I need to know which price function is called when product is added to cart as i have overridden the function getFinalPrice() but still when product is added to cart it takes the default price. Why ?

Thanks


texts: How do I disable payment method in check out?

texts:
i want to do the following thing in checkout. When I have a product in checkout which has its attribute code (card_only) selected to "Da" then i want to disable a shipping method in checkout.

I created my module with an observer:

<?php

class Netlogiqpayment_Paymenttype_Model_Observer{

    public function paymenttype2(Varien_Event_Observer $observer){

        $payments = Mage::getSingleton('payment/config')->getActiveMethods();
        // $payment = $order->getPayment();

        $cart = Mage::getModel('checkout/cart')->getQuote();
        $shippingMethod = $cart->getShippingAddress()->getShippingMethod();
        $products_id_array = array(); $i = 0;
        foreach ($cart->getAllItems() as $item) {
            //$productName = $item->getProduct()->getName()."<br>";
           //$productPrice = $item->getProduct()->getPrice();
            $products_id_array[$i] = $item->getProduct()->getId();
            $i++;
        }
        $c = 0; $attribute_values = array();
        for ($i=0; $i < count($products_id_array); $i++) {
            $productId = $products_id_array[$i];
            $product = Mage::getModel('catalog/product')->load($productId);
            $attributes = $product->getAttributes();
            foreach ($attributes as $attribute) {
                $attributeCode = $attribute->getAttributeCode();
                if ($attributeCode == 'card_only') {
                    $attribute_values[$c] =  $attribute->getFrontend()->getValue($product);
                    $c++;
                }
            }
        }
        if (in_array("Da", $attribute_values)){
             //disable shipping method with card
        }else{
            // enable all shipping method
        }

}

}

and this is my config.xml content:

<?xml version="1.0"?>
<config>
    <modules>
        <Netlogiqpayment_paymenttype>
            <version>0.1.0</version>
        </Netlogiqpayment_paymenttype>
    </modules>
    <global>
        <events>
            <controller_action_postdispatch_gomage_checkout_onepage_index>
                <observers>
                    <paymenttypetest>
                        <type>singleton</type>
                        <class>paymenttype/observer</class>
                        <method>paymenttype2</method>
                    </paymenttypetest>
                </observers>
            </controller_action_postdispatch_gomage_checkout_onepage_index>
        </events>
        <models>
            <paymenttype>
                <class>Netlogiqpayment_Paymenttype_Model</class>
                <resourceModel>paymenttype_mysql4</resourceModel>
            </paymenttype>
        </models>
       <!--  <sales>
            <quote>
                <item>
                    <paymenttype/>
                </item>
            </quote>
        </sales> -->
    </global>
</config>


texts:
I'd created a module and the url for the same is something like:

http://magento.korenpub.com/designer/index/index/id/26/value/Joseph%20B.%20Soloveitchik

but I need to rewrite the url to

http://magento.korenpub.com/author/id/26/value/Joseph%20B.%20Soloveitchik

How can it be done with config.xml? I'd read this blog which describes such, but I'm unable to do it for my module.

Code from config.xml

<global>
    <rewrite>
        <designer_url>
            <from><![CDATA[#^/author/id/$#]]></from>
            <to><![CDATA[/designer/index/index/id/$1]]></to>
            <complete>1</complete>
        </designer_url>
    </rewrite>
</global>


texts: What is the minimum core module set necessary for developing custom application with Magento2?

texts: I need to develop a custom application using the Magento 2 framework. What are the minimum core modules necessary to achieve this?


texts: How to search name referenceBlock and referenceContainer in magento 2 theme

texts:
I want custom my theme but when use name=" name class html " it do not working. Please help me

My Code: default.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceBlock name="report.bugs" remove="true"/>
    <referenceContainer name="header.container">
        <referenceBlock name="reviews.actions" remove="true"/>
        <referenceBlock name="product.attribute" remove="true"/>
        <referenceBlock name="product.info.detailed" remove="true"/>
        <referenceBlock name="page.title.wrapper.product" remove="true"/>
        <referenceBlock name="top.search" display="true"/>
        <referenceBlock name="logo">
            <arguments>
                <argument name="logo_file" xsi:type="string">images/mystoretheme-logo.png</argument>
            </arguments>
        </referenceBlock>
    </referenceContainer>
</body>


texts: Magento 2 - Get Catalog rule name and end date on product page

texts:
I am trying to display a countdown timer using http://keith-wood.name/countdown.html on my product page to show the remaining time of the catalog rule that applies to that product

I have started with

   $_product = $block->getProduct();

if($_product->getSpecialPrice()){
    echo('<!-- special price -->');
    echo $_product->getSpecialPrice();
    // get special end date
    echo $_product->getSpecialToDate();

}

But it returns nothing, I need the end date to set the timer.

Any tips would be helpful.


texts: I have few categories with custom URL. Basically I am using these categories to launch filter navigation pages from the menu. Is it recommnended to use both noindex/nofollow or just noindex? I am running magento 1.9.1


texts: How i can set magento promotions with defined hours?

texts:
Is there a way to defined hours with each promotion in magento so that promotion will be active only in that specified hours.

Also how we can active time with date in special prices date in magento product edit page.


texts:
I just did a fresh installation of Magento 1.9.0.1 and I am seeing some very odd behavior with the customer login form.

In Chrome (version 36) the login form does not work. I am just redirected to the login page. There is no error message. However, when I open a new Incognito Window, I am able to login just fine. Thinking this was a cookie problem, I cleared out all my cookies from the browser and tried again and I got the same results. In both cases, I am able to login to the admin panel without any issues.

I have also tried this in both Firefox and Safari. Firefox I would see the same thing happen (but not consistently and I could fix it by clearing the cookies) and I could not replicate in Safari.

I have never had an issue with this in any other version of Magento. Is there some kind of fundamental change in the way Magento handles cookies in version 1.9 and/or is there something I can do to make this more stable?


texts: Magento 2: REST API Add options to product

texts:
Issue: Cannot add options to a product via API

I cannot add an option to a product via the Magento 2 REST API.

According to the API Documentation (http://devdocs.magento.com/swagger/index_20.html#/) AND under the title "catalogProductCustomOptionRepositoryV1"

I should be able to add an option using following format:

{
"option":{
  "productSku": "SomeExistingSKU",
  "optionId": 1,
  "title": "Size",
  "type": "drop_down",
  "sortOrder": 1,
  "isRequire": true,
  "max_characters": 0,
 "image_size_x": 0,
 "image_size_y": 0,
  "values": [
    {
      "title": "5",
      "sortOrder": 0
    }
  ],
  "extensionAttributes": {}
}

When I attempt to do this in POSTMAN for example I get the following message:

"message": "No such entity."

The product already exists in Magento with the same SKU so that is not the problem


texts: Magento2 blank white screen after clicking on custom menu item

texts:
When I print anything from controller it works, but when i try to add .phtml with this code, blank screen appears

  app/code/Company/Configuration/view/adminhtml/layout/configuration_admin_settings.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">

        <title>
            Greetings
        </title>

        <referenceContainer name="content">
            <block class="Magento\Backend\Block\Template" template="Company_configuration::masterSettings.phtml"/>
        </referenceContainer>

</page>

and phtml file inside

  app/code/Company/Configuration/view/adminhtml/templates/masterSettings.phtml-

Hello World!


texts: Daily Email update to admin about Newly added product information

texts:
I am having multi-vendor store where one sub-admin add the product and main-admin take care of configuration, tax, shipping etc.

Now the main admin needed email notification at the end of the day about newly added products by the sub-admin, in that day.

I am not cleared with that how can I send email to main admin at the end of the day with newly added product information.?

Sending a mail is not a problem but getting newly added products at the end of day is not cleared for me.

I thought, It can be done by CRON Job, I need to create script that run at the end of the day, The script contains code to get newly added product by comparing created_at date of each product,

Is there any better way to do it?

Thanks in advance for your valuable responses.


texts: visibility attribute value is not rendering from product collection in magento 2

texts:
We need to display the visibility of the product in category page, but currently we are not able to fetch its value from product object.

We tried with $_attributeLabel = $_product->getResource()->getAttribute($_code)->getFrontendLabel();

It is not working,we have Magento ver. 2.2.5.


texts: Magento 2: How to create new Checkout Step and put the redirection?

texts:
I need to add a new Checkout step and when I click on that step it should be redirected to the view cart page. I have created a new step already and below is my js code. How can make the redirection over the step.
define(
    [
        'ko',
        'uiComponent',
        'underscore',
        'Magento_Checkout/js/model/step-navigator',
        'Magento_Customer/js/model/customer'
    ],
    function (
        ko,
        Component,
        _,
        stepNavigator,
        customer
    ) {
        'use strict';
        /**
        * check-login - is the name of the component's .html template
        */
        return Component.extend({

            //add here your logic to display step,
            isVisible: ko.observable(true),
            isLogedIn: customer.isLoggedIn(),
            //step code will be used as step content id in the component template
            stepCode: 'mycart',
            //step title value
            stepTitle: 'My cart',

            /**
            *
            * @returns {*}
            */
            initialize: function () {
                this._super();
                // register your step
                stepNavigator.registerStep(
                    this.stepCode,
                    //step alias
                    null,
                    this.stepTitle,
                    //observable property with logic when display step or hide step
                    this.isVisible,

                    _.bind(this.navigate, this),

                    /**
                    * sort order value
                    * 'sort order value' < 10: step displays before shipping step;
                    * 10 < 'sort order value' < 20 : step displays between shipping and payment step
                    * 'sort order value' > 20 : step displays after payment step
                    */
                    7
                );

                return this;
            },

            /**
            * The navigate() method is responsible for navigation between checkout step
            * during checkout. You can add custom logic, for example some conditions
            * for switching to your custom step
            */
            navigate: function () {

            },

            /**
            * @returns void
            */
            navigateToNextStep: function () {
                stepNavigator.navigateTo('payment');
            }
        });
    }
);

Please guide


texts:
Connection string invalid:
  'ftp://example:password@example.com/public_html/'

This is error message in magento connect manage page.
What seems to be the problem with it?


texts: How to get the pub/media Url in Email Templates Magento2

texts:
Can anyone help me how to include Pub/medial url in email templates in magento2.

Thanks


texts:
I Have Try to store followers on store Database. I have some Problem

 <?php $connectionresource = Mage::getSingleton('core/resource');
    $readconnection = $connectionresource->getConnection('core_read');
    $allrecord = $readconnection->select()->from(array('userdata'=>'followup')) ->where('userdata.cus_mail=?', $email)->where('userdata.seller_id=?', $sellerid);
    $alldata =$readconnection->fetchAll($allrecord);
     if(!$alldata){?>
    <form action="<?php echo Mage::getUrl('followup/index/follow') ?>" method="post" id="follow-up">
        <?php $myStatus = Mage::getSingleton('customer/session')->isLoggedIn() ?>
        <?php if($myStatus): ?>
            <input type="hidden" id="sellerid" name="sellerid" value="<?php echo $partner->getMageuserid();?>" class="Follow-up-email-sellerid">
            <input type="submit" value="Follow Up" class="Follow-up-email">
            <?php else: ?>

<a href="<?php echo Mage::getUrl('customer/account/login');?>" title="Customer Register">Follow Up

        <?php endif ?>
    </form>
    <?php }
    else{?>
        <form action="<?php echo Mage::getUrl('followup/index/follow') ?>" method="post" id="follow-up">
        <?php $myStatus = Mage::getSingleton('customer/session')->isLoggedIn() ?>
        <?php if($myStatus): ?>
            <input type="hidden" id="sellerid" name="sellerid" value="<?php echo $partner->getMageuserid();?>" class="Follow-up-email-sellerid">
            <input type="submit" value="Following" class="Follow-up-email">
            <?php else: ?>

<a href="<?php echo Mage::getUrl('customer/account/login');?>" title="Customer Register">Follow Up

        <?php endif ?>
    </form>

   <?php  }?>

I can't able to find out the problem. What Mistake I done here??


texts:
In an effort to learn how to work with Magento I have set myself a number of (what i believe will be) basic tasks. The aim being to give me an idea of how to access information of the customer, products etc and apply that to the dashboard, product page, payment page etc. I give this intro as my request my seem a little over the top for a real store.

=====

AIM

=====

get logged in customers name (DONE)
make sure the first name and last name are in capitals (DONE)

apply it to

Welcome, "logged in customer" (in the header)
MY ACCOUNT (left side bar)
My Dashboard (content area heading)
Hello "logged in customer" (content area above account information)
ACCOUNT INFORMATION (content area)

so the above locations, say:

"logged in customers" Account
"logged in customers" Dashboard
"logged in customer" has registered with main store
"logged in customers" Information
Contact information for "logged in customer"

Do I need to create a module containing a helper or observer or even override the core module (I have learnt enough to know I do not edit the core directly). I would also like to understand the reason why I would do one or another.

I appreciate that most of what i am trying to do is completed by adding a bit of code to the relevant template, what I am trying to do is work out the best way to do it

=======================

SUMMARY OF QUESTIONS

=======================

to add new data into a .phtml file should I copy that data and place it in my own file which I then customise or is there a better way?
to change the users first and last name to uppercase, should I override Mage_Page_Block_Html_Header or create a module that contains a helper or an observer to set the users name to uppercase first


texts: upload product image from external url using object manager

texts:
i want to upload image from url to magento media path using object manager
i have created a code for it
the url image is saved to my media folder but not assigning to product
it returns that image doesn't exist but the file was uploaded to my temp_upload folder

Any suggestion would be helpful

public function addImageFromUrl($urlToImage)
    {
    $objectManager = $bootstrap->getObjectManager();
    $state = $objectManager->get('Magento\Framework\App\State');
    $state->setAreaCode('frontend');
    $directory = $objectManager->get('\Magento\Framework\Filesystem\DirectoryList');
    $mySaveDir  =  $directory->getRoot()."/pub/media/temp_upload/";
    $filename = basename($urlToImage);
    $completeSaveLoc = $mySaveDir.$filename;
     if(!file_exists($completeSaveLoc)){
         try {
             file_put_contents($completeSaveLoc,file_get_contents($urlToImage));
             return $completeSaveLoc;
            }
         catch (Exception $e){
              echo $e->getMessage();
                }
     }
}
$imageUrlPath = "https://www.festisite.com/static/partylogo/img/logos/google.png";
if(!empty($imageUrlPath))
    {
    $returnUploadedImagePath = $this->addImageFromUrl($imageUrlPath);
    $_product->addImageToMediaGallery($returnUploadedImagePath, array('image','thumbnail','small_image'), false);
    }


texts: Difference between the API interfaces in Api and Api/data folders?

texts:
API interfaces are available in Api and Api/data folders,

what is the basic difference between these two api types?


texts: difference between Model\ProductRepository and Api\ProductRepositoryInterface

texts:
What is the difference between using \Magento\Catalog\Model\ProductRepository and \Magento\Catalog\Api\ProductRepositoryInterface?

Which one is better and recommended to use?


texts:
I am wanting to dig in to what the shipping API calls send and return. Example, I want to see what magento is sending UPS and what UPS is returning.

Can someone point me in the right direction to quickly find this code? I looked in the shipping and cart modules but did not find what I was looking for.

I thought it would be here.

Mage_Shipping_Model_Rate_Request

However, in 1.9 it appears to be not used.

Thanks!


texts: Call an external URL and post data to it (same as an HTML form does) from a controller

texts:
Is it possible to use $this->_redirect() in a controller to call an external url and post data to it the same way an HTML form does in Magento 2.2?

If yes, how?

If no, any suggested alternatives on how to achieve this?


texts: Show/Hide Editor not working in magento 2.2.4

texts:
Show/Hide editor is not working in static blocks. I am getting following Errors in the console -

  Refused to execute script from
  https://www.example.com/admin/cms/block/edit/block_id/20/key/f3ee116b456375338c3747b3ab97692ba62457613c332ab989c7d8431ce2841f//plugins/style/editor_plugin.js

  because its MIME type ('text/html') is not executable, and strict MIME
  type checking is enabled.


texts: Add new field in customer billing and shipping page

texts:
I used this tutorial: Add new field in magento(1.9) customer registration to add new custom field in magento.

But I want to show custom field in billing and shipping address. How to do this?


texts: Create product in code: Transaction errors (please HELP, critical!) - NEW!

texts:
I am fetching products from external API and create magento products out of this data. I use Magento 1.9.
After a few inserts/updates, I get an error:

PHP Fatal error:  Some transactions have not been committed or rolled back

I use following code to create products in for each:

try
{
    Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
    $product = Mage::getModel("catalog/product");
    $productId = $product->getIdBySku("xxxx");
    if(!$productId)
    {
        // new product
        $product->setStoreId(1);
        $product->setWebsiteIds([1]);
        $product->setCreatedAt(strtotime("now"));
        $product->setUpdatedAt(strtotime("now"));
        $product->setTypeId("simple");
        $product->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH);
        $product->setSku("xxxx");
        $product->setCategoryIds([12]);
        $product->setEan($ean);
        $product->setWeight($weight * 1000);
    }
    else
    {
        // load existing product
        $product = $product->load($productId);

        // reset images
        $mediaApiItems = $mediaApi->items($productId);
        foreach($mediaApiItems as $item)
        {
            $mediaApi->remove($productId, $item["file"]);
        }
        $product->save();

        // load again with new image data
        $product = $product->load($productId);
    }

    $product->setName("title");
    $product->setDescription("desc");
    $product->setShortDescription("desc");
    $product->setIsMassupdate(true);
    $product->setExcludeUrlRewrite(true);
    $product->setName("xxxx");
    $product->setCountryOfManufacture("USA");
    $product->setPrice(0.00);
    $product->setMetaTitle($articleStruct["title"]);
    $product->setMetaDescription("desc");

    // attributes
    $product->setAttributeSetId(10);
    $attr = [
                    "manufacterer" => "brand",
                    "modell" => "modell",
                    "custom_stock_status" => "",
                    "hide_default_stock_status" => 1,
                    "custom_stock_status_qty_based" => 0,
                    "farbe_konf" => 15,
                    "delivery_time" => $this->delivery
            ];
    $product->addData($attr);
    $product->setTaxClassId(1);

    $product->setStockData([
                    "use_config_manage_stock" => 0,
                    "manage_stock" => 1,
                    "min_sale_qty" => 1,
                    "max_sale_qty" => 1,
                    "is_in_stock" => 1,
                    "qty" => 1
            ]);
    $product->setStatus(1);

    $product->setMediaGallery(["images"=>[], "values"=>[]]);
    foreach ($articleStruct["images"] as $i => $imageUrl)
    {
        $saveLocation = $imageSaveDir . basename($imageUrl);

        // save image in file system
        if (!file_exists($saveLocation))
        {
            $curl = $this->getCurlClient($imageUrl);
            $data = curl_exec($curl);
            curl_close($curl);

            file_put_contents($saveLocation, $data);
        }

        if ($i == 0)
            $product->addImageToMediaGallery($saveLocation, ["image", "thumbnail", "small_image"], false, false);
        else
            $product->addImageToMediaGallery($saveLocation, [], false, false);
    }

    $product->save();
}
catch (Exception $e)
{
    Mage::log($e->getMessage());
    throw $e;
}

what is wrong?


texts: How to disable sku from dashboard ? Magento 2

texts: I need to disable Sku from the dashboard and not from the code, is this possible?


texts: Cannot save product attribute in magento 2

texts: I've created an attribute in Magento 2 of the Input Type Dropdown. I am facing this issue when trying to add a new option value to that attribute and saving. Error is "The value of Admin must be unique".


texts: Failed to load Payment Method in System->Configuration in Magento 1.8.1

texts:
I am using Magento CE 1.8.1 and when I go to System->Configuration and click on "payment methods", It doesn't go anywhere. It tries loading and fails without any error at :

http://www.yantrascollection.com/index.php/admin/system_config/edit/section/payment/key/e231c4cfbded937e9ac9070c38fed05e/

It is a clean install from the new download of their website, and I don't know what is wrong.

This is my first try with Magento so I may not have done something right.

Please, can anyone help me out?


texts: Magento 2.3.5p-1 and Elasticsearch 6.8.11 fielddata error

texts:
After update Magento version to 2.3.5-p1 and Elasticsearch to the 6.8.11 vesrions I got error message on the product catalog page
[{"type":"illegal_argument_exception","reason":"Fielddata is disabled on text fields by default. Set fielddata=true on [updated_at] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead."}]

This is happens because of default sorting by updated_at field which type is "text" inside elasticsearch index. Could someone help on this? Setting fielddata is not an option as I understand, because magento will created new elasticsearch indexes after magento reindex. Thank you.


texts: Manage categories page does not exist in my admin panel

texts:
I am unable to access my manage categories option in my magento admin panel.
When i click on the manage categories ,it show that page does not exist.

It redirects to my old website url of 404 not found page.

I copied new adminhtml of magento in it, but still this error is showing up.
When I open a product, here when I open  manage   products  , then go to edit of product, after the product page is opened. In product page,There is categories option tab ,here the all categories are displaying.

I searched on google but didn't get any specific answer to this problem.  Should I have to make any change in database to view manage categories page properly.


texts:
In category view the dropdown "sort by" is translated.
When I choose an option, the default one turns into English


texts: magento 2.1 product custom option extra field like Quantity?

texts:
I want to add custom field for quantity in custom option value like given in image.
I tried following Magento 2 add new custom option text field but it add earlier while i need it with custom option value.

Any help will be appreciated.


texts: I have just completed a new installation and have noticed that the "Add to Cart" message is appearing on every page. Any ideas as to why this is happening?


texts: How to register customer in magento 2 with Address data using API?

texts:
Register customer in Magento 2 with Address data using API

I am able to register customer without Address Data.


texts: How to apply null value filter for magento admin grid

texts:
I have added an additional column to sales grid in admin by adding the following to sales_order_grid.xml
 <column name="email_sent" >
        <argument name="data" xsi:type="array">
            <item name="options" xsi:type="object">Magento\Config\Model\Config\Source\Yesno</item>
            <item name="config" xsi:type="array">
                <item name="sortOrder" xsi:type="number">60</item>
                <item name="filter" xsi:type="string">select</item>
                <item name="label" translate="true" xsi:type="string">Email Sent</item>
                <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/select</item>
                <item name="dataType" xsi:type="string">select</item>
                <item name="editor" xsi:type="array">
                    <item name="editorType" xsi:type="string">select</item>
                </item>
            </item>
        </argument>
    </column>

and then added
protected function _initSelect()
    {
        $salesOrderTable = $this->getTable('sales_order');
        $this->addFilterToMap('email_sent', "${salesOrderTable}.email_sent");
        parent::_initSelect();
    }

To extended app/code/Vender/Sales/Model/ResourceModel/Order/Grid/Collection.php file.
To be able to filter on js side, I also added if null condition
$this->getSelect()
            ->joinLeft(
                $salesOrderTable,
                "main_table.entity_id = ${salesOrderTable}.entity_id",
                ['IFNULL(email_sent,0) as email_sent']
            )

It does filter out for yes, but when I apply no filter, it returns 0 record.
Is there anything that I am missing.?


texts: Overriding template not working in dev branch

texts:
I have overridden a file

  vendor/magento/module-customer-custom-attributes/view/frontend/templates/customer/address/edit.phtml

and placed the replaced file in:

  app/design/frontend/ParentTheme/childTheme/Magento_CustomerCustomAttributes/templates/customer/address/edit.phtml

This overriding works fine in local, but if I deploy the same to the dev branch, it shows a completely blank page.

Can anyone please help me with this?

Thanks


texts: How to Implement Structured Data for grouped product in Magento 1.9

texts: I Implement Structured Data for simple product but i cant do for grouped product Please help if any one know about grouped product.


texts: Load my regsitartion page in CMS page - Magento 2

texts:
My registration page is coming from path:

  /app/design/frontend/Mgs/claue/Magento_Customer/templates/form/register.phtml

I am trying to load that in a CMS page. Not sure how to do that. Tried many ways but no luck.
including {{block class="Magento\Customer\Block\Form\Register" name="custom-create"  template="Magento_Customer/templates/form/register.phtml"}}

How to include that in CMS page?


texts: How to access model in bundle block class?

texts:
I have overwrited the bundle class usig di.xml

  preference for="Magento\Bundle\Block\Catalog\Product\View\Type\Bundle"type="Bachus\BundleContextPros\Block\Catalog\Product\View\Type\Bundle" />

in my custom module. Now I want to write a method in this class which will create my model (Bunleset) wchih I created In my cusotm module. I want to get some data form my custom table here.

my method in Bachus\BundleContextPros\Block\Catalog\Product\View\Type\Bundle.php

class Bundle extends \Magento\Catalog\Block\Product\View\AbstractView
{
 ...

 public function generateJsContext(){
        $model = new \Bachus\BundleContextPros\Model\Bundleset();

        foreach($this->getOptions() as $option){

            $title =  $option->getTitle();

            }
        return $title;
    }

but I get error like that:

Uncaught TypeError: Argument 1 passed to Magento\Framework\Model\AbstractModel::__construct() must be an instance of Magento\Framework\Model\Context, none given, called in

I know my model bundleset class, reasourcecollection etc. are ok beacuse I have followed Alanstorm CRUD tutoral And I can fetch the data in example blocks. But I need this data in Bundle class method to then display it on option.phtml. Please Help


texts: Simple sitemap in html format as static block for Magento (/sitemap)

texts:
we use a sitemap.xml and robots.txt to tell everyone where it is.

Now: we are looking for a human readible version of the sitemap - and want to print the contents of the complete sitemap file in html links as a list on a webpage (accessed through /sitemap per store view)

I was looking into widgets and static block calls and thought there must be an easy way to do this?

Does anyone have experiences with this?

Result is something like the image below

Many thanks!


texts: Magento 2. Where is the catalog search ES index created?

texts:
Magento creates an index in ES for various search features.
I'm interested where in the code is index created/updated/repopulated?
I'm thinking some cron or indexer. I've looked in module-catalog-search and module-catalog-advanced-search but can't seem to find the code that actually builds and sends the request to ES.
EDIT: \Magento\Elasticsearch\Model\Adapter\Index\Builder::build() this what I have atm.


texts: Put products in all categories of the tree?

texts:
Suppose I'm creating a category tree with several levels, call them L1, L2, L3, L4.

My inclination is to put products within the leaf node of each path through the tree. Where most of my products have 3 categories they would be in L3 categories, some in L4 categories.

Is there any reason I'd want to also put the products in the L1 and L2 categories? For search or any other reason? Are there themes that expect a product to reside in all categories down to the leaf?


texts: How to add another flat rate shipping option?

texts:
Magento 1.9.1
Porto theme

I am trying to add another Flat rate shipping option.

I followed these steps here but I am not certain as to where to find the 2nd Flat rate shipping option:

How to add multiple flat rate shipping

(it's the step that starts with:

You could also create a second flat rate shipping method with a module. and has a +150 bounty awarded to it)

I looked in the Admin under Shipping methods but it's not there.

If this is not going to work at all - is there another way to do this?

UPDATED on April 15th, 2019:

I am trying to set this up on Magento 1.9.4 but it does not appear to be working. It gives the following Error:

There has been an error processing your request
Exception printing is disabled by default for security reasons.

Error log record number: 1248949596922

This is the content of that Error log:

a:5:{i:0;s:141:"Cannot send headers; headers already sent in /home/mainDOMAIN/public_html/app/code/local/Prashant/Flatrate2/Model/Carrier/Flatrate2.php, line 1";i:1;s:1677:"#0 /home/mainDOMAIN/public_html/lib/Zend/Controller/Response/Abstract.php(148): Zend_Controller_Response_Abstract->canSendHeaders(true)
#1 /home/mainDOMAIN/public_html/app/code/core/Mage/Core/Controller/Response/Http.php(107): Zend_Controller_Response_Abstract->setRedirect('https://www.528...', 302)
#2 /home/mainDOMAIN/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(711): Mage_Core_Controller_Response_Http->setRedirect('https://www.528...')
#3 /home/mainDOMAIN/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(689): Mage_Core_Controller_Varien_Action->setRedirectWithCookieCheck('checkout/cart', Array)
#4 /home/mainDOMAIN/public_html/app/code/core/Mage/Checkout/controllers/CartController.php(98): Mage_Core_Controller_Varien_Action->_redirect('checkout/cart')
#5 /home/mainDOMAIN/public_html/app/code/core/Mage/Checkout/controllers/CartController.php(278): Mage_Checkout_CartController->_goBack()
#6 /home/mainDOMAIN/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Checkout_CartController->addAction()
#7 /home/mainDOMAIN/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('add')
#8 /home/mainDOMAIN/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#9 /home/mainDOMAIN/public_html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#10 /home/mainDOMAIN/public_html/app/Mage.php(686): Mage_Core_Model_App->run(Array)
#11 /home/mainDOMAIN/public_html/index.php(83): Mage::run('thisSTORE', 'website')
#12 {main}";s:3:"url";s:126:"/index.php/checkout/cart/add/uenc/aHR0cHM6Ly93d3cuNTI4MGdvdXJtZXQuY29tL2luZGV4LnBocC8,/product/2111/form_key/hFNgXCWFfaEydW3g/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"thisSTORE";}


texts: Magento2 - Disabled modules causing errors in cron schedule

texts:
I have disabled the modules for all the forced third party modules - temando, yotpo etc.

But they still get added to the cron schedules and cause errors - even though the administration no longer shows the cron block

How is it possible that a disabled module still has code executed and how can I stop this?

The crontab.xml of at least some disabled modules are being added to the schedule even though the modules are disabled.

Is there a way to override a module that has defined a crontab.xml so that cron entries are removed, without removing files that are part of the M2 distribution?I know I can override the schedule, which would already be better, but is there a way to disable/remove?

UPDATE: would creating a separate cron group that generates schedules "almost never" work? is changing what cron group a crontab entry belongs to something I could override in a custom module?


texts: Magento 2 REST API: extension attribute for saleability not working for some products

texts:
I needed product's stock status in the product listing API:

  V1/products?searchCriteria[filter_groups][0][filters][0][field]=category_id&searchCriteria[filter_groups][0][filters][0][value]=144

So I made a plugin as follows:

<?php

            namespace Vendor\StockInfoAPI\Plugin;

            use Magento\Catalog\Api\Data\ProductInterface;

            class ProductGet{
            protected $productExtensionFactory;
            protected $productFactory;

            public function __construct(
                \Magento\Catalog\Api\Data\ProductExtensionFactory $productExtensionFactory,
                \Magento\Catalog\Model\ProductFactory $productFactory,
                \Magento\CatalogInventory\Api\StockStateInterface $stockItem,
                \Psr\Log\LoggerInterface $logger,
                \Magento\Store\Model\StoreManagerInterface $storeManager,
                \Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface $mediaGallery,
                \Magento\Eav\Model\Config $eavConfig
            )
            {
                $this->productFactory = $productFactory;
                $this->storeManager = $storeManager;
                $this->logger = $logger;
                $this->stockItem = $stockItem;
                $this->productExtensionFactory = $productExtensionFactory;
                $this->eavConfig = $eavConfig;
                $this->mediaGallery = $mediaGallery;
            }

            public function afterGet(
                \Magento\Catalog\Api\ProductRepositoryInterface $subject,
                \Magento\Catalog\Api\Data\ProductInterface $product){

                $product = $this->getExtensionAttributesItem($product);
                return $product;
            }

            protected function getExtensionAttributesItem(\Magento\Catalog\Api\Data\ProductInterface $product)
            {
                $imageUrl = $this->storeManager->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA);
                if($product->getImage()){
                    $product->setCustomAttribute("image", $product->getImage());
                }
                if (!$product->isSaleable()){
                    $qty = "Out of Stock";
                }
                else{
                    $qty = "In-Stock";
                }
                $extensionattributes = $product->getExtensionAttributes();

                $extensionattributes->setQty($qty);
                $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
                $productCollection = $objectManager->create('Magento\Catalog\Model\Product')->loadByAttribute('sku', $product->getSku());
                $productPriceBySku = $productCollection->getPrice();
                $extensionattributes->setPrice($productPriceBySku);
                $product->setExtensionAttributes($extensionattributes);

                return $product;

            }

            /**
             * @param \Magento\Catalog\Api\ProductRepositoryInterface $subject
             * @param \Magento\Catalog\Model\ResourceModel\Product\Collection $products
             * @return \Magento\Catalog\Model\ResourceModel\Product\Collection
             * @SuppressWarnings(PHPMD.UnusedFormalParameter)
             */
                public function afterGetList(
                \Magento\Catalog\Api\ProductRepositoryInterface $subject,
                $products
                )
                {
                    foreach ($products->getItems() as $product) {
                        $this->afterGet($subject, $product);
                    }
                    return $products;
                }
            }

As you can see, I am essentially using the same function for fetching the details in product listing API and the product detail API:

  V1/products/:SKU

Now the problem is: for some products, I am getting wrong stock status in the listing API.

In the product detail it is working fine.

Any suggestions?


texts: In Grid record search using ajax? and How can set Reset button for reset data of custom form?

texts:
I created grid and custom form admin side. when i press on row it will open the form and there is one button for reset i click on it, it won't work. i tried to set action in controller and other thing but it not work.

and other problem is that in grid when i search data from particular column it reset whole page and display answer but i want to get output through ajax so, that page will not refresh.
How can i set ajax code?


texts:
Which is the right procedure to install a new language in Magento2?

I downloaded the Italian language package from the site Crowdin https://crowdin.com/project/magento-2/it

What I get is a zip whose structure is

app/
dev/
lib/

I unzipped the archive in my Magento2 root installation and tried to set Italian locale from my backend but nothing happens in the frontend.

Which is the right way do install a new language?


texts: I have styles.css and styles2.css when i merge CSS it does not add styles2.css in merged file.


texts: Change the options of my custom attribute product using plugin M2

texts:
I have created a custom attribute for product with static options but i want them to be dynamic i tried to created it with dynamic value via  the class Options but i got error and i can't resolve it so after the suggestion of Alex one member in this forum i decided to change the value oof options accoring to some calcul of the currect product that i created and then make my product config accoring to this attribute he also gave me this link Magento2 - programmatically add product attribute options but i feel lost please help me achieve this task and thanks in advance

code :`

namespace Mdweb\ConfigAttribute\Model\Config\Source;

use Magento\Eav\Model\ResourceModel\Entity\Attribute\OptionFactory;
use Magento\Framework\DB\Ddl\Table;

class Options extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource
{
    /**
     * @var OptionFactory
     */
    protected $optionFactory;
    protected $registry;
    protected $prixchoix;
    protected $colchoix;
    /**
     * @var \BO\Choix\Model\Choix
     */
    protected $_choice;

/**
 * @param OptionFactory $optionFactory
 */
public function __construct(OptionFactory $optionFactory, \Magento\Framework\Registry $registry,
                            \BO\Prix\Model\Prix $choixprix,
                            \BO\Choix\Model\Choix $choix)
{
    //you can use this if you want to prepare options dynamically

    $this->optionFactory = $optionFactory;
    $this->registry = $registry;
    $this->prixchoix = $choixprix;
    $this->_choice = $choix;
}

/**
 * Get all options
 *
 * @return array
 */
public function getAllOptions()
{

    $_product = $this->registry->registry('current_product');

    $_sku = $_product->getSku();
    if (isset($_sku)){

    $var1 = substr($_sku, 0, 1);

    $var2 = substr($_sku, 1, 2);

    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $resource = $objectManager->get('Magento\Framework\App\ResourceConnection');
    $connection = $resource->getConnection();
    $tableName = $resource->getTableName('table_prix');

    $fields = array('prix_unitaire');

    $sql = $connection->select()
        ->from($tableName, $fields)
        ->where('code_famille' . '=?', $var1)
        ->where('code_nom_commercial' . '=?', $var2)
        ->join('table_choix',
            'table_choix.choix_id = table_prix.code_choix',
            [
                'designation_choix'
            ]);

    $result = $connection->fetchAll($sql);

    if ($result) {
        $i = 0;
        foreach ($result as $elt) {
            $this->_options[$i] = ['label' => " Choix" . $elt['designation_choix'] . "-" . $elt['prix_unitaire'] . "£", 'value' => " Choix" . $elt['designation_choix'] . "-" . $elt['prix_unitaire'] . "£"];
            $i++;
        }

    }  else{
        $this->_options = [ ['label' => __('No'), 'value'=>'0'], ['label' => __('Yes'), 'value'=>'1'], ['label' => __('Other'), 'value'=>'2'] ];
    }

    return  $this->_options;

}}`

and this is the result when i try to access the detailed product attribute


texts:
I'm trying to get an overview over a Magento installation which was done by some other guy. It looks like a complete
mess to me. Here is one thing I dont' quite understand, maybe someone can help?

The shop uses a theme called theme123 but I don't find where this is configured. According to my knowledge of the theme fallback system it should not be used at all.

In Magento's backend configuration the package is 'default' and all theme names etc. are set to 'custom'.

This is the structure of the app directory:

app
  design
    frontend
      default
      custom
      theme123
      ...

And this ist the skin directory:

skin
  frontend
    default
      theme123

The 'custom' directory under app is nearly empty (just one template file).

So why is theme123 used? Where might theme123 be configured? According to my knowledge of the fallback system some default/default should be used since there is no 'custom' theme. The templates use getSkinUrl() which returns the theme123 path.

When this is correct: Why? If not: Which hack did the other guy use to get it to work? Maybe he hard-coded the theme name, but where?


texts: Custom extension disable functionality is not working

texts:
I have created a custom extension.

I created tabs in system > configuration tab to enable and disable of extension. Now options for enable and disable is visible in back end.

Now the extension is active but even selecting enable to 'no' at admin panel.